9 Matching Annotations
- May 2021
-
github.com github.com
-
Because of that, it's essential that the bundler doesn't treat the package as an external dependency. You can either modify the external option under server in rollup.config.js or the externals option in webpack.config.js,
-
- Oct 2020
-
rollupjs.org rollupjs.orgRollup1
-
If you do want to include the module in your bundle, you need to tell Rollup how to find it. In most cases, this is a question of using @rollup/plugin-node-resolve.
-
- Sep 2020
-
engineering.mixmax.com engineering.mixmax.com
-
When you publish this module, you do not want to bundle React, for the reasons described above. (It would be even worse to bundle React in a library, because then its copy would duplicate that loaded by the application!) But the fix is slightly different for a library than an application. In this library's Rollup configuration, we only want to specify external, not globals:
-
many CDNs nowadays ultimately source from npm (before caching the JavaScript on their own edge servers). So you'll be guaranteed to have the same library version on the CDN as on npm
-
Why bundling 3rd-party dependencies can be a very bad idea
-
So React, and other large third-party dependencies, should not be bundled alongside your application; they should be kept external. But where will they come from then?
-
The only module names that Rollup understands out of the box are relative or absolute file paths, like ./maths.js in the example. This works just fine for your own code—but what about 3rd-party dependencies?
-
-
rollupjs.org rollupjs.orgRollup1
-
Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses, and determine if an import should be external. If null is returned, the import could not be resolved by Rollup or any plugin but was not explicitly marked as external by the use
-