9 Matching Annotations
  1. May 2021
    1. 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,
  2. Oct 2020
    1. 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.
  3. Sep 2020
    1. 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:
    2. 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
    3. Why bundling 3rd-party dependencies can be a very bad idea
    4. 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?
    5. 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?
    1. 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