question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add instructions for Vite

See original GitHub issue
const stdLibBrowser = require('node-stdlib-browser');
const inject = require('@rollup/plugin-inject');

module.exports = {
  resolve: {
    alias: stdLibBrowser,
  },
  plugins: [
    {
      ...inject({
        global: [
          require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
          'global',
        ],
        process: [
          require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
          'process',
        ],
        Buffer: [
          require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
          'Buffer',
        ],
      }),
      enforce: 'post',
    },
  ],
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
sriksm19commented, Feb 7, 2022

adding this to the above seems to work:

optimizeDeps: {
    include: ['buffer', 'process'],
},
1reaction
niksycommented, Feb 8, 2022

OK, I’ve managed to recreate it, and indeed, optimizeDeps fixes it. I will update documentation with examples.

Thank you all for your support! I’m glad this is helping others since I haven’t seen any progress in this space.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started - Vite
create -vite is a tool to quickly start a project from a basic template for popular frameworks. Check out Awesome Vite for community...
Read more >
Deploying a Static Site - Vite
You can deploy your Vite app as a Static Site on Render. ... Specify a project name and branch. ... Click Create Static...
Read more >
Plugin API - Vite
Check out install instructions in the vite-plugin-inspect docs. ... Users will add plugins to the project devDependencies and configure them using the ...
Read more >
Configuring Vite
Because it's implemented as straightforward text replacements without any syntax ... For TypeScript users, make sure to add the type declarations in the ......
Read more >
Using Plugins - Vite
For compatible Rollup plugins, check out Vite Rollup Plugins for a list of compatible official Rollup plugins with usage instructions or the Rollup...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found