UNPKG

rollup

Version:

Next-generation ES module bundler

1,197 lines (859 loc) 186 kB
# rollup changelog ## 2.27.1 *2020-09-17* ### Bug Fixes * Do not fail when using ES module imports in symlinked config files (#3783) ### Pull Requests * [#3783](https://github.com/rollup/rollup/pull/3783): Handle loading symlinked config files (@lukastaegert) ## 2.27.0 *2020-09-16* ### Features * Support specifying a file extension when reading from stdin (#3775) ### Bug Fixes * Do not break logic if a branch with hoisted variables is tree-shaken in an else-if statement (#3782) ### Pull Requests * [#3770](https://github.com/rollup/rollup/pull/3770): Docs: Exception for babel plugin and commonjs plugin (@jsk7) * [#3775](https://github.com/rollup/rollup/pull/3775): add ability to specify stdin file extension via --stdin=ext (@kzc) * [#3782](https://github.com/rollup/rollup/pull/3782): Handle hoisted variables in dead branches of nested if statements (@lukastaegert) ## 2.26.11 *2020-09-08* ### Bug Fixes * Do not fail for unknown nodes as if statement branches (#3769) ### Pull Requests * [#3769](https://github.com/rollup/rollup/pull/3769): Handle debugger statements as if-statement branches (@lukastaegert) ## 2.26.10 *2020-09-04* ### Bug Fixes * Do not create invalid code when simplifying expressions in return statements that contain line comments (#3762) ### Pull Requests * [#3757](https://github.com/rollup/rollup/pull/3757): Fix api docs loadconfigfile (@maxwell8888) * [#3762](https://github.com/rollup/rollup/pull/3762): Handle line-comments when removing line-breaks to prevent ASI (@lukastaegert) ## 2.26.9 *2020-09-01* ### Bug Fixes * Add regular expression support to watch include/exclude types (#3754) ### Pull Requests * [#3754](https://github.com/rollup/rollup/pull/3754): Add RegExp to the include and exclude fields of the WatcherOptions type (@dagda1) * [#3756](https://github.com/rollup/rollup/pull/3756): Update FAQ: I think it was meant "external" instead of "other-entry.js" (@madacol) ## 2.26.8 *2020-08-29* ### Bug Fixes * Make sure that both unresolved and resolved ids are passed to the `external` option in all cases (#3753) ### Pull Requests * [#3753](https://github.com/rollup/rollup/pull/3753): Also pass resolved ids to external if they use the object for (@lukastaegert) ## 2.26.7 *2020-08-28* ### Bug Fixes * Avoid invalid code when rendering hoisted variable declarations from dead branches (#3752) * Mark the `options` parameter of `this.parse` as optional for TypeScript plugins (#3750) ### Pull Requests * [#3750](https://github.com/rollup/rollup/pull/3750): Make `options` of `PluginContext#parse` optional (@intrnl) * [#3752](https://github.com/rollup/rollup/pull/3752): Extract hoisted variables from dead branches (@lukastaegert) ## 2.26.6 *2020-08-27* ### Bug Fixes * Avoid conflicts between the namespace of synthetic named exports and local variables (#3747) ### Pull Requests * [#3747](https://github.com/rollup/rollup/pull/3747): Properly deconflict synthetic named exports (@lukastaegert) ## 2.26.5 *2020-08-22* ### Bug Fixes * Use correctly deconflicted variable names for reexported namespaces in ES formats (#3742) ### Pull Requests * [#3742](https://github.com/rollup/rollup/pull/3742): Avoid variable name conflict when reexporting several namespaces from a chunk (@lukastaegert) ## 2.26.4 *2020-08-19* ### Bug Fixes * Fix a situation where invalid code was rendered when dynamically importing a module with synthetic named exports when preserving modules (#3738) * Create a proper namespace object when in a non-es format, a namespace is imported from a chunk with `default` export mode (#3738) * Use the same variable when in a chunk, a namespace is both imported and reexported as a binding (#3738) * Do not include the synthetic namespace in static entry points unless it is actually used (#3738) * Make sure the chunking of one output does not interfere with the namespace objects of another output (#3738) ### Pull Requests * [#3738](https://github.com/rollup/rollup/pull/3738): Improve synthetic entry handling (@lukastaegert) ## 2.26.3 *2020-08-16* ### Bug Fixes * Fix a situation where line-breaks in a nested simplified conditional expression could result in broken code (#3734) ### Pull Requests * [#3734](https://github.com/rollup/rollup/pull/3734): Prevent ASI when simplifying a nested logical expression (@lukastaegert) ## 2.26.2 *2020-08-16* ### Bug Fixes * Fix a situation where line-breaks in a simplified conditional expression could result in broken code (#3732) ### Pull Requests * [#3732](https://github.com/rollup/rollup/pull/3732): Prevent unintended ASI for nested conditionals (@lukastaegert) ## 2.26.1 *2020-08-16* ### Bug Fixes * Correctly render external namespace imports when only generating SystemJS output (#3731) ### Pull Requests * [#3731](https://github.com/rollup/rollup/pull/3731): Render system namespace import (@sastan and @lukastaegert) ## 2.26.0 *2020-08-15* ### Features * Add a new entry `importedBindings` to the bundle information to list bindings per dependency (#3722) ### Bug Fixes * Do not render an invalid UMD wrapper when no bindings are imported from a dependency (#3724) * Avoid situations where removing the `else` branch from an `if` statement might catch the `else` branch from another one (#3725) ### Pull Requests * [#3722](https://github.com/rollup/rollup/pull/3722): Add import specifiers to bundle information (@lukastaegert) * [#3724](https://github.com/rollup/rollup/pull/3724): Fix missing variables for UMD and IIFE builds (@lukastaegert) * [#3725](https://github.com/rollup/rollup/pull/3725): Do not entirely remove else branch if another else branch might accidentally be referenced (@lukastaegert) ## 2.25.0 *2020-08-14* ### Features * Add `--failAfterWarnings` CLI flag that will complete builds with warnings but return an error at the end (#3712) ### Pull Requests * [#3712](https://github.com/rollup/rollup/pull/3712): Implement `--failAfterWarnings` flag (@tjenkinson) ## 2.24.0 *2020-08-13* ### Features * Allow defining interop per dependency via a function (#3710) * Support interop "auto" as a more compatible version of "true" (#3710) * Support interop "default" and "esModule" to avoid unnecessary interop helpers (#3710) * Support interop "defaultOnly" for simplified helpers and Node ESM interop compatible output (#3710) * Respect interop option for external dynamic imports (#3710) * Support live-bindings for external default imports in non-ES formats unless "externalLiveBindings" is "false" (#3710) * Use shared default interop helpers for AMD, UMD and IIFE formats (#3710) * Avoid unnecessarily deconflicted module variables in non-ES formats (#3710) * Freeze generated interop namespace objects (#3710) * Always mark interop helpers as pure (#3710) * Avoid default export interop if there is already an interop namespace object (#3710) * Sort all `require` statements to the top in CommonJS output for easier back-transpilation to ES modules by other tools (#3710) ### Bug Fixes * Handle accessing `super` in static class fields (#3720) * Deconflict the names of helper variables introduced for interop (#3710) * Generate proper namespace objects for static namespace imports in non-ES formats (#3710) * Do not add unused interop helpers when using the renderDynamicImport hook (#3710) ### Pull Requests * [#3710](https://github.com/rollup/rollup/pull/3710): Rework interop handling (@lukastaegert) * [#3720](https://github.com/rollup/rollup/pull/3720): Handle super in static class fields (@lukastaegert) ## 2.23.1 *2020-08-07* ### Bug Fixes * Fix an issue where dynamically importing an entry point could return a malformed namespace for CJS and AMD formats (#3709) ### Pull Requests * [#3709](https://github.com/rollup/rollup/pull/3709): Properly construct namespace when dynamically importing chunks with facades in default export mode (@lukastaegert) ## 2.23.0 *2020-07-23* ### Features * Handle environments with only globalThis in UMD output (#3691) ### Pull Requests * [#3691](https://github.com/rollup/rollup/pull/3691): Check for globalThis in UMD wrapper (@lukastaegert) ## 2.22.2 *2020-07-21* ### Bug Fixes * Always generate correct exports when an implicit entry is reexporting from another module (#3688) ### Pull Requests * [#3688](https://github.com/rollup/rollup/pull/3688): Include all relevant modules to generate reexports for implicit dependencies (@lukastaegert) ## 2.22.1 *2020-07-18* ### Bug Fixes * Remove unused arguments when calling a conditional expression (#3680) ### Pull Requests * [#3680](https://github.com/rollup/rollup/pull/3680): Allow tree-shaking of arguments of functions that are returned by conditional expressions (@lukastaegert) ## 2.22.0 *2020-07-18* ### Features * Allow resolving synthetic named exports via an arbitrary export name (#3657) * Display a warning when the user does not explicitly select an export mode and would generate a chunk with default export mode when targeting CommonJS (#3657) ### Pull Requests * [#3657](https://github.com/rollup/rollup/pull/3657): Add basic support for using a non-default export for syntheticNamedExports (@lukastaegert) * [#3659](https://github.com/rollup/rollup/pull/3659): Warn when implicitly using default export mode (@lukastaegert) ## 2.21.0 *2020-07-07* ### Features * Allow plugins to disable tree-shaking for individual modules to ensure even empty modules are associated with chunks (#3663) ### Pull Requests * [#3663](https://github.com/rollup/rollup/pull/3663): Disable treeshaking per module (@lukastaegert) ## 2.20.0 *2020-07-06* ### Features * Support using a function to generate different chunk and asset naming patterns per chunk or asset (#3658) * Add `referencedFiles` property to the chunk info in generateBundle to list referenced assets (#3661) ### Pull Requests * [#3658](https://github.com/rollup/rollup/pull/3658): Add ability to use a function that returns a pattern string in all places where you could use a pattern string before (@frank-dspeed) * [#3661](https://github.com/rollup/rollup/pull/3661): Add referenced files to bundle (@lukastaegert) ## 2.19.0 *2020-07-05* ### Features * Allow plugins to return a Promise in the options hook (#3660) ### Pull Requests * [#3660](https://github.com/rollup/rollup/pull/3660): Make options hooks async (@TomerAberbach) ## 2.18.2 *2020-07-02* ### Bug Fixes * Do not remove spread element args when the corresponding positional parameter is unused (#3652) ### Pull Requests * [#3652](https://github.com/rollup/rollup/pull/3652): Do not tree-shake arguments that contain a spread element (@lukastaegert) ## 2.18.1 *2020-06-26* ### Bug Fixes * Make sure synthetic exports are present when a module is imported dynamically (#3648) * Strip the `rollup-plugin-` prefix off the plugin name when looking for the plugin export in a CLI plugin without a default export (#3647) * Convert plugin names with dashes to camel case when looking for the plugin export in a CLI plugin without a default export (#3647) ### Pull Requests * [#3647](https://github.com/rollup/rollup/pull/3647): Strip rollup-plugin prefix to find named plugin exports, throw when export cannot be found (@lukastaegert) * [#3648](https://github.com/rollup/rollup/pull/3648): Always create a dynamic namespace object when a module with synthetic named exports is imported dynamically (@lukastaegert) ## 2.18.0 *2020-06-22* ### Features * `inlineDynamicImports`, `manualChunks` and `preserveModules` can now be used as output options (#3645) * Use sourcemaps for certain warnings that reference source code locations (#3645) ### Bug Fixes * `this.getFileName` will now always return the correct file name for chunks when multiple outputs are created (#3645) ### Pull Requests * [#3645](https://github.com/rollup/rollup/pull/3645): Per output chunking (@lukastaegert) ## 2.17.1 *2020-06-19* ### Bug Fixes * Properly resolve accessing properties of namespace members again (#3643) ### Pull Requests * [#3643](https://github.com/rollup/rollup/pull/3643): Fix accessing nested properties of namespaces (@lukastaegert) ## 2.17.0 *2020-06-17* ### Features * When importing Rollup via package.exports, always fall back to the browser ESM build for non-Node environments (#3634) * Create more efficient code when handling namespace mutations (#3637) ### Bug Fixes * Fix a severe performance regression when the same module is imported by a lot of modules (#3641) * Properly escape special characters in imports (#3638) ### Pull Requests * [#3634](https://github.com/rollup/rollup/pull/3634): Set browser build in exports (@guybedford) * [#3637](https://github.com/rollup/rollup/pull/3637): Do not include the whole namespace when illegally mutating a namespace (@lukastaegert) * [#3638](https://github.com/rollup/rollup/pull/3638): Support backslash escaping, retain exact newline escaping (@guybedford) * [#3641](https://github.com/rollup/rollup/pull/3641): Fix performance regression when a file is imported by many importers (@lukastaegert) ## 2.16.1 *2020-06-13* ### Bug Fixes * Do not produce invalid code when an external or chunk id contain quotes or line-breaks (#3632) * Do not fail but emit a warning when mutating a namespace object (#3633) ### Pull Requests * [#3632](https://github.com/rollup/rollup/pull/3632): Handle single quote escaping in ids (@guybedford) * [#3633](https://github.com/rollup/rollup/pull/3633): Turn namespace assignment error into a warning (@guybedford) ## 2.16.0 *2020-06-12* ### Features * Add support for numeric separators (#3626) * Switch to finalized ESTree optional chaining AST (#3628) ### Pull Requests * [#3626](https://github.com/rollup/rollup/pull/3626): Support numeric separator (@TrySound) * [#3628](https://github.com/rollup/rollup/pull/3628): Acorn 7.3.0 upgrade (@guybedford) * [#3631](https://github.com/rollup/rollup/pull/3631): Improve discoverability of `manualChunks` for code splitting (@zlamma) ## 2.15.0 *2020-06-08* ### Features * Allow to skip watching some configs via `watch: false` (#3620) * Provide the resolved sourcemap path to `sourcemapPathTransform` (#3617) ### Pull Requests * [#3617](https://github.com/rollup/rollup/pull/3617): Update sourcemapPathTransform to also take the path to the sourcemap file as a second argument (@dgoldstein0) * [#3620](https://github.com/rollup/rollup/pull/3620): Rollup watch only one config in exported array (@luwol03) ## 2.14.0 *2020-06-07* ### Features * Make `this.meta.watchMode` available for plugins to detect watch mode (#3616) ### Bug Fixes * Handle exporting the same binding with different names in SystemJS (#3575) ### Pull Requests * [#3575](https://github.com/rollup/rollup/pull/3575): Handle some cases of duplicate export bindings (@joeljeske) * [#3616](https://github.com/rollup/rollup/pull/3616): Make watch mode available in plugins (@lukastaegert) ## 2.13.1 *2020-06-04* ### Bug Fixes * Prevent conflicts in SystemJS when `module` is used as a top-level variable (#3614) ### Pull Requests * [#3614](https://github.com/rollup/rollup/pull/3614): Handle system reserved identifier dedupes (@guybedford) ## 2.13.0 *2020-06-03* ### Features * Allow to specify that an emitted chunk is only loaded after a given module has loaded to improve chunking (#3606) ### Pull Requests * [#3606](https://github.com/rollup/rollup/pull/3606): Enable specifying implicit dependencies when emitting chunks (@lukastaegert) ## 2.12.1 *2020-06-02* ### Bug Fixes * Render valid imports when chunk names correspond to directory names in virtual setups (#3609) ### Pull Requests * [#3609](https://github.com/rollup/rollup/pull/3609): Handle imports from chunks with names that correspond to parent directory names of other chunks (@guybedford) ## 2.12.0 *2020-05-31* ### Features * Add an option `--waitForBundleInput` to let the build wait until all entry point files are available before starting (#3577) ### Pull Requests * [#3577](https://github.com/rollup/rollup/pull/3577): Wait for bundle input option (@Heerschop) ## 2.11.2 *2020-05-28* ### Bug Fixes * Include side-effects in the second argument of `Array.from` (#3604) ### Pull Requests * [#3604](https://github.com/rollup/rollup/pull/3604): Mark `Array.from` as side-effectful, use two-argument Array.from when mapping Sets (@lukastaegert) ## 2.11.1 *2020-05-28* ### Bug Fixes * Also include side-effects in files that are marked as side-effect-free if they contain an included default export that is reexported (#3602) ### Pull Requests * [#3602](https://github.com/rollup/rollup/pull/3602): Handle side-effects next to side-effect-free default exports in case the default export is reexported (@lukastaegert) ## 2.11.0 *2020-05-27* ### Features * Add basic support for optional chaining (#3582) * Provide a normalized set of options with proper default values to `buildStart` and `renderStart` (#3597) * Do not count adding properties to the prototype of an unused class as a side-effect (#3598) * Support providing `null` for empty setters in SystemJS via option (#3592) ### Bug Fixes * Do not fail when using a `/*#__PURE__*/` annotation inside a class field (#3599) * Allow using `--watch` and `--treeshake` together with sub-options such as `--watch.clearScreen` on the command line (#3597) ### Pull Requests * [#3582](https://github.com/rollup/rollup/pull/3582): Support optional chaining via acorn fork(@guybedford) * [#3592](https://github.com/rollup/rollup/pull/3592): System format optional setters(@guybedford) * [#3597](https://github.com/rollup/rollup/pull/3597): Provide normalized options (@lukastaegert) * [#3598](https://github.com/rollup/rollup/pull/3598): Treeshake prototype modifications in classes (@lukastaegert) * [#3599](https://github.com/rollup/rollup/pull/3599): Retain pure annotations in class fields (@lukastaegert) * [#3601](https://github.com/rollup/rollup/pull/3601): Fix white-space in docs (@tu4mo) ## 2.10.9 *2020-05-24* ### Bug Fixes * Prevent invalid exports when facades are created (#3590) ### Pull Requests * [#3590](https://github.com/rollup/rollup/pull/3590): Prevent unneeded exports when entry facades are created and ensure all exported variables in facades are imported (@lukastaegert) ## 2.10.8 *2020-05-23* ### Bug Fixes * Fix issues when synthetic named exports are reexported as default exports (#3586) ### Pull Requests * [#3584](https://github.com/rollup/rollup/pull/3584): Clarify documentation for `output.paths` (@jacksteamdev) * [#3585](https://github.com/rollup/rollup/pull/3585): Target Node.js v14 instead of v13 in Windows tests (@mangs) * [#3586](https://github.com/rollup/rollup/pull/3586): Handle default reexports of synthetic named exports over several stages (@lukastaegert) ## 2.10.7 *2020-05-22* ### Bug Fixes * Handle modules re-exporting namespaces without further own code (#3576) ### Pull Requests * [#3576](https://github.com/rollup/rollup/pull/3576): Fix "cannot read exports of undefined" error (@guybedford) ## 2.10.6 *2020-05-22* ### Bug Fixes * Fix some issues around class fields (#3580) * Prevent a maximum call stack error when a called entity references itself in its declaration (#3581) ### Pull Requests * [#3580](https://github.com/rollup/rollup/pull/3580): Update acorn class features (@guybedford) * [#3581](https://github.com/rollup/rollup/pull/3581): Do not fail when including call arguments of recursively defined variables (@lukastaegert) ## 2.10.5 *2020-05-19* ### Bug Fixes * Do not remove side-effects that may influence an included default export declaration when side-effects are disabled (#3572) ### Pull Requests * [#3572](https://github.com/rollup/rollup/pull/3572): Observe side-effects in files containing a default export declaration that reexports a variable (@lukastaegert) ## 2.10.4 *2020-05-19* ### Bug Fixes * Tree-shake unused classes with fields unless there are side-effects in the field declaration (#3569) ### Pull Requests * [#3569](https://github.com/rollup/rollup/pull/3569): Make sure unused classes with fields are tree-shaken if possible (@lukastaegert) ## 2.10.3 *2020-05-18* ### Bug Fixes * Validate return value of sourcemapPathTransform option (#3561) ### Pull Requests * [#3561](https://github.com/rollup/rollup/pull/3561): Throw error if sourcemapPathTransform-option does not return a string (@Simonwep) ## 2.10.2 *2020-05-15* ### Bug Fixes * Properly include calls to mutating array methods in certain scenarios (#3559) ### Pull Requests * [#3559](https://github.com/rollup/rollup/pull/3559): Make sure UnknownFooExpressions are included when referenced as return values in a MultiExpression (@lukastaegert) ## 2.10.1 *2020-05-15* ### Bug Fixes * Do not throw when "undefined" is used as a default export (#3558) ### Pull Requests * [#3558](https://github.com/rollup/rollup/pull/3558): Properly handle default exporting undefined (@lukastaegert) ## 2.10.0 *2020-05-13* ### Features * Avoid unnecessary empty imports from a facade chunk to the original chunk (#3552) * Pin facade creation order so that if several user-defined chunks reference the same module, the first always becomes the "actual" chunk while the later ones become facades (#3552) ### Bug Fixes * Do not omit reexports from secondary chunks when creating facades for entry points without hoisting transitive dependencies (#3552) ### Pull Requests * [#3552](https://github.com/rollup/rollup/pull/3552): Avoid unnecessary facade dependency inlining (@guybedford) ## 2.9.1 *2020-05-11* ### Bug Fixes * Do not create unintended live-bindings or invalid reexports when reexporting global variables (#3550) ### Pull Requests * [#3550](https://github.com/rollup/rollup/pull/3550): Track updates of globals that are exported as default (@lukastaegert) ## 2.9.0 *2020-05-10* ### Features * Add ids of static and dynamic imports to `this.getModuleInfo` (#3542) * Provide `getModuleInfo` and `getModuleIds` to `manualChunks` functions (#3542) * Add nullish coalescing support (#3548) * Make the rebuild delay in watch mode configurable and set the default to `0` for snappy rebuilds (#3502) * Add `this.getModuleIds` to the plugin context as future replacement for `this.moduleIds` (#3542) ### Pull Requests * [#3502](https://github.com/rollup/rollup/pull/3502): Configurable build delay (@mattdesl) * [#3542](https://github.com/rollup/rollup/pull/3542): Extend manualChunks API (@lukastaegert) * [#3548](https://github.com/rollup/rollup/pull/3548): Support nullish coalescing with tree-shaking (@lukastaegert) ## 2.8.2 *2020-05-07* ### Bug Fixes * Avoid invalid code when simplifying the body of a shorthand arrow function expression (#3540) ### Pull Requests * [#3540](https://github.com/rollup/rollup/pull/3540): Wrap object expressions in parentheses if they become children of an arrow function expression (@lukastaegert) ## 2.8.1 *2020-05-07* ### Bug Fixes * Allow using plugins on CLI that are exported as `exports.default` (#3529) * Do not fail side-effect detection in nested callbacks of builtins (#3539) ### Pull Requests * [#3529](https://github.com/rollup/rollup/pull/3529): Use default named export with plugins (@NotWoods) * [#3539](https://github.com/rollup/rollup/pull/3539): Track call side-effects both by entity and CallExpression to avoid untracked side-effects in nested calls (@lukastaegert) ## 2.8.0 *2020-05-06* ### Features * When a dynamically imported chunk contains more exports than the imported module namespace, do not create a facade chunk but an inline namespace (#3535) ### Bug Fixes * Do not execute dynamically imported code before synchronous code in the importing module when generating CommonJS (#3535) ### Pull Requests * [#3535](https://github.com/rollup/rollup/pull/3535): Avoid dynamic facade chunks (@lukastaegert) ## 2.7.6 *2020-04-30* ### Bug Fixes * Fix a type issue when a default export references a global variable (#3526) ### Pull Requests * [#3526](https://github.com/rollup/rollup/pull/3526): Handles default exporting global variables (@lukastaegert) ## 2.7.5 *2020-04-29* ### Bug Fixes * Prevent infinite loop when default values of function parameters in a default export contain a slash (#3522) ### Pull Requests * [#3522](https://github.com/rollup/rollup/pull/3522): Avoid infinite loop when finding position for id insertion in default export (@lukastaegert) ## 2.7.4 *2020-04-29* ### Bug Fixes * Fix an issue where wrong variable names were used when preserving modules (#3521) ### Pull Requests * [#3521](https://github.com/rollup/rollup/pull/3521): Fix and improve default export alias logic (@lukastaegert) ## 2.7.3 *2020-04-27* ### Bug Fixes * Do not access `__proto__` when running Rollup (#3518) ### Pull Requests * [#3518](https://github.com/rollup/rollup/pull/3518): use acorn-class-fields and acorn-static-class-features from npm (@nitsky) ## 2.7.2 *2020-04-22* ### Bug Fixes * Prevent an infinite loop when creating separate manual chunks with circular dependencies (#3510) * Do not fail if "super" is used in the definition of a class field (#3511) * Throw if a plugin tries to emit a file with an absolute Windows path (#3509) ### Pull Requests * [#3509](https://github.com/rollup/rollup/pull/3509): Ban emitFile via absolute paths on Windows OS (@SASUKE40) * [#3510](https://github.com/rollup/rollup/pull/3510): Do not fail for circular imports between manual chunks (@lukastaegert) * [#3511](https://github.com/rollup/rollup/pull/3511): Support "super" in class fields (@lukastaegert) ## 2.7.1 *2020-04-21* ### Bug Fixes * Use correct path for dynamic imports if `output.paths` is used (#3508) ### Pull Requests * [#3508](https://github.com/rollup/rollup/pull/3508): Respect output.paths in dynamic imports (@lukastaegert) ## 2.7.0 *2020-04-21* ### Features * Add `preserveEntrySignatures` option to control how exports of entry points are handled (#3498) * Add `preserveSignature` flag to `this.emitFile` to control exports of emitted chunks (#3498) * Add `output.minifyInternalExports` option to control if internal exports are minified (#3498) ### Pull Requests * [#3498](https://github.com/rollup/rollup/pull/3498): Add option to configure if entry signatures are preserved (@lukastaegert) ## 2.6.1 *2020-04-12* ### Bug Fixes * Close watch mode when stdin closes in a non-TTY environment (#3493) ### Pull Requests * [#3493](https://github.com/rollup/rollup/pull/3493): Ensure --watch mode exits correctly when stdin is closed (@jakesgordon) ## 2.6.0 *2020-04-10* ### Features * Allow regular expressions to declare external modules (#3482) ### Pull Requests * [#3482](https://github.com/rollup/rollup/pull/3482): Allow regular expressions in config.external (@johannes-z) ## 2.5.0 This version is identical to 2.4.0 ## 2.4.0 *2020-04-09* ### Features * Add support for most private and public class field features (#3488) ### Bug Fixes * Do not replace `this` with `undefined` in class field definitions (#3488) ### Pull Requests * [#3488](https://github.com/rollup/rollup/pull/3488): Rollup class fields support (@guybedford and @lukastaegert) ## 2.3.5 *2020-04-09* ### Bug Fixes * Never remove labels when tree-shaking is disabled (#3492) ### Pull Requests * [#3492](https://github.com/rollup/rollup/pull/3492): Always use a new inclusion context when including declarations of variables, always inlcude labels when not treeshaking (@lukastaegert) ## 2.3.4 *2020-04-07* ### Bug Fixes * Handle re-exporting synthetic exports from entry-points (#3319) * Fix cross-chunk imports of synthetic exports (#3319) * Handle namespace objects that contain re-exported synthetic namespaces (#3319) ### Pull Requests * [#3319](https://github.com/rollup/rollup/pull/3319): Handle re-exports of synthetic named exports (@manucorporat and @lukastaegert) ## 2.3.3 *2020-04-04* ### Bug Fixes * Add external namespaces to dynamic namespace objects (#3474) ### Pull Requests * [#3474](https://github.com/rollup/rollup/pull/3474): Support external star exports on namespace objects (@guybedford) ## 2.3.2 *2020-03-31* ### Bug Fixes * Only warn but do not fail build when a namespace is called as a function (#3475) * Make sure pre-existing sourcemap comments are also removed when rebuilding using the cache (#3476) ### Pull Requests * [#3475](https://github.com/rollup/rollup/pull/3475): Call namespace error as a warning (@guybedford) * [#3476](https://github.com/rollup/rollup/pull/3476): Store locations for removed comments in cache (@lukastaegert) ## 2.3.1 *2020-03-30* ### Bug Fixes * Do not fail if the config file returns an function returning a Promise (#3472) ### Pull Requests * [#3472](https://github.com/rollup/rollup/pull/3472): Fix support for async functions as config (@lukastaegert) ## 2.3.0 *2020-03-29* ### Features * Do not transpile config files with `.mjs` extension in Node 13+ or `.cjs` extension in any Node version and load them appropriately (#3445) * Extract helper to load a config file the way rollup does it via `rollup/dist/loadConfigFile` (#3445) ### Bug Fixes * Keep watching the config file if an error occurs during initial load in watch node (#3445) * Add a helpful error message when using a transpiled config in a repository with "type": "module" (#3445) ### Pull Requests * [#3445](https://github.com/rollup/rollup/pull/3445): Support native ESM configs in Node 13, support untranspiled configs (@lukastaegert) * [#3468](https://github.com/rollup/rollup/pull/3468): Don't use esm output format alias in the documentation (@vsn4ik) ## 2.2.0 *2020-03-24* ### Features * Add `renderDynamicImport` hook to rewrite dynamic import expressions (#3449) * Add information about dynamically imported modules to `this.getModuleInfo` (#3449) ### Bug Fixes * Make file emission work with Uin8Array sources when using Rollup in the browser (#3452) * Fix types to allow watch to accept an array of configs (#3453) * Do not strip `.js` extensions from AMD imports when the import is a user-supplied replacement for a non-resolvable dynamic import target (#3453) ### Pull Requests * [#3449](https://github.com/rollup/rollup/pull/3449): Add hook to rewrite dynamic import expressions (@lukastaegert) * [#3452](https://github.com/rollup/rollup/pull/3452): Avoid the assumption of Buffer in browser envs (@JoviDeCroock) * [#3453](https://github.com/rollup/rollup/pull/3453): fix types since watch accepts single or array config (@lukeed) * [#3456](https://github.com/rollup/rollup/pull/3456): fix SystemJS url in tutorial (@guybedford) ## 2.1.0 *2020-03-18* ### Features * Allow specifying an importer when emitting files to resolve relative ids (#3442) ### Pull Requests * [#3442](https://github.com/rollup/rollup/pull/3442): Add optional `importer` parameter to `this.emitFile` (@lukastaegert) ## 2.0.6 *2020-03-13* ### Bug Fixes * Do not use file names from different outputs when generating sourcemaps using the `dir` option (#3440) ### Pull Requests * [#3440](https://github.com/rollup/rollup/pull/3440): Use correct file names when writing sourcemaps for multiple outputs (@lukastaegert) ## 2.0.5 *2020-03-12* ### Bug Fixes * Fix an issue where conditional statements would assume they have the wrong test value (#3438) ### Pull Requests * [#3438](https://github.com/rollup/rollup/pull/3438): Make sure logical expressions always check the left argument for side-effects (@lukastaegert) ## 2.0.4 *2020-03-12* ### Bug Fixes * Avoid conflicts between namespace imports when preserving modules (#3435) ### Pull Requests * [#3435](https://github.com/rollup/rollup/pull/3435): Deconflict multiple `index` imports for ES format using nested export star statements (@kamranayub) ## 2.0.3 *2020-03-10* ### Bug Fixes * Add type for this.getCombinedSourcemap to transform context (#3431) ### Pull Requests * [#3377](https://github.com/rollup/rollup/pull/3377): Switch to yargs-parser lib (@jamesgeorge007) * [#3426](https://github.com/rollup/rollup/pull/3426): Use strict types with PluginDriver (@NotWoods) * [#3431](https://github.com/rollup/rollup/pull/3431): Add missing type declaration for getCombinedSourcemap (@Anidetrix) * [#3432](https://github.com/rollup/rollup/pull/3432): Detail how return values from `augmentChunkHash` are used (@jakearchibald) ## 2.0.2 *2020-03-07* ### Bug Fixes * Make sure the ESM import still works (#3430) ### Pull Requests * [#3430](https://github.com/rollup/rollup/pull/3430): Fix conditional exports again (@lukastaegert) ## 2.0.1 *2020-03-07* ### Bug Fixes * Reenable importing rollup in Node 13.0 - 13.7 (#3428) ### Pull Requests * [#3428](https://github.com/rollup/rollup/pull/3428): Fix conditional exports in Node 13.0 - 13.7 (@lukastaegert) ## 2.0.0 *2020-03-06* ### Breaking Changes * Rollup now requires at least Node 10 to run, or a sufficiently modern browser (#3346) * The file structure of Rollup's ESM builds has changed: - The main ESM entry point is now at `rollup/dist/es/rollup.js` instead of `rollup/dist/rollup.es.js` - The ESM browser build is at `rollup/dist/es/rollup.browser.js` instead of `rollup/dist/rollup.browser.es.js` In general, the ESM builds now follow the same naming scheme as the CJS builds but are located in the `rollup/dist/es` subfolder instead of `rollup/dist` (#3391) * The "watch.chokidar" option no longer accepts a `boolean` value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance (#3331) * Modules that are completely tree-shaken will no longer be listed as part of any chunks in `generateBundle` * The `experimentalOptimizeChunks` and `chunkGroupingSize` options have been removed * [acorn](https://github.com/acornjs/acorn) plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet (#3391) * Emitted chunks now have the TypeScript type `Uint8Array` instead of `Buffer`. A `Buffer` can still be used, though (#3395) * The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types (#3395) * The signature of the `writeBundle` plugin hook has been changed to match `generateBundle`: The bundle object is now passed as second parameter instead of first and the first parameter is the output options (#3361) * The following plugin hooks have been removed: - ongenerate: use `generateBundle` instead - onwrite: use `writeBundle` instead - transformBundle: use `renderChunk` instead - transformChunk: use `renderChunk` instead * You can no longer access `this.watcher` on the plugin context. * The `transform` hook can no longer return `dependencies`. * The `treeshake.pureExternalModules` option will now show a deprecation warning when used: use `treeshake.moduleSideEffects: 'no-external'` instead * Using `import.meta.ROLLUP_ASSET_URL_<..>` and `import.meta.ROLLUP_CHUNK_URL_<..>` in code will now show warnings: use `import.meta.ROLLUP_FILE_URL_<..>` instead * The `resolveAssetUrl` hook will now show a deprecation warning when used: use `resolveFileUrl` instead * The following plugin context functions will show warnings when used: - `this.emitAsset`: use `this.emitFile` - `this.emitChunk`: use `this.emitFile` - `this.getAssetFileName`: use `this.getFileName` - `this.getChunkFileName`: use `this.getFileName` - `this.isExternal`: use `this.resolve` - `this.resolveId`: use `this.resolve` * Directly adding properties to the bundle object in the `generateBundle` is deprecated will show a warning (removing properties is allowed, though): Use `this.emitFile` * Accessing `chunk.isAsset` on the bundle is deprecated: Use `chunk.type === 'asset'` instead * The error code for a missing `name` property when targeting UMD has been changed to `MISSING_NAME_OPTION_FOR_IIFE_EXPORT` to emphasize this is needed for the IIFE part of UMD (#3393) ### Features * Rollup now bundles [Chokidar](https://github.com/paulmillr/chokidar) for a better watch experience (#3331) * Rollup now bundles [acorn](https://github.com/acornjs/acorn) again, removing its only external dependency (#3391) * Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary (#3369) * Rollup can now be imported as an ES module in Node via `import {rollup} from 'rollup'`. Note that this relies on Node's experimental [conditional package exports](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_conditional_exports) feature and is therefore itself experimental (#3391) * `systemjs` can be used as format alias for `system` (#3381) ### Bug Fixes * Unknown output options now trigger a warning when using the JavaScript API (#3352) * Rollup will no longer introduce Node types into TypeScript projects that do not use them (#3395) * Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle (#3423) ### Pull Requests * [#3331](https://github.com/rollup/rollup/pull/3331): Bundle Chokidar (@lukastaegert) * [#3343](https://github.com/rollup/rollup/pull/3343): Remove experimentalOptimizeChunks (@lukastaegert) * [#3346](https://github.com/rollup/rollup/pull/3346): Update minimum required Node version to 10 (@lukastaegert) * [#3352](https://github.com/rollup/rollup/pull/3352): Remove active deprecations (@lukastaegert) * [#3361](https://github.com/rollup/rollup/pull/3361): Change writeBundle signature to match generateBundle (@lukastaegert) * [#3369](https://github.com/rollup/rollup/pull/3369): Avoid empty imports from side-effect-free chunks (@lukastaegert) * [#3381](https://github.com/rollup/rollup/pull/3381): Rename esm to es everywhere, add systemjs alias (@lukastaegert) * [#3391](https://github.com/rollup/rollup/pull/3391): Bundle acorn, allow importing Rollup as Node ES module, update dependencies (@lukastaegert) * [#3393](https://github.com/rollup/rollup/pull/3393): Better error code for name-less umd bundle (@rail44) * [#3395](https://github.com/rollup/rollup/pull/3395): Remove `@types` dependencies (@lukastaegert) * [#3423](https://github.com/rollup/rollup/pull/3423): Update magic-string and fix sourcemaps (@lukastaegert) ## 1.32.1 *2020-03-06* ### Bug Fixes * Handle default export detection for AMD and IIFE externals that do not have a prototype (#3420) * Handle missing whitespace when the else branch of an if-statement is simplified (#3421) * Mention the importing module when reporting errors for missing named exports (#3401) * Add code to warning for missing output.name of IIFE bundles (#3372) ### Pull Requests * [#3372](https://github.com/rollup/rollup/pull/3372): Add warning code for missing output.name of IIFE bundle that has export (@rail44) * [#3401](https://github.com/rollup/rollup/pull/3401): Missing exports errors now print the importing module (@timiyay) * [#3418](https://github.com/rollup/rollup/pull/3418): Structure lifecycle hooks, add links to build time hooks (@lukastaegert) * [#3420](https://github.com/rollup/rollup/pull/3420): Update generated code of getInteropBlock() to work with null prototype objects (@jdalton) * [#3421](https://github.com/rollup/rollup/pull/3421): Avoid invalid code when "else" branch is simplified (@lukastaegert) ## 1.32.0 *2020-02-28* ### Features * Allow adding plugins on the command line via `--plugin <plugin>` (#3379) ### Pull Requests * [#3379](https://github.com/rollup/rollup/pull/3379): introduce CLI --plugin support (@kzc) * [#3390](https://github.com/rollup/rollup/pull/3390): fix typo: this.addWatchfile (@mistlog) * [#3392](https://github.com/rollup/rollup/pull/3392): Bump codecov from 3.6.1 to 3.6.5 * [#3404](https://github.com/rollup/rollup/pull/3404): Update resolveFileUrl docs (@jakearchibald) ## 1.31.1 *2020-02-14* ### Bug Fixes * Make sure errored files are always re-evaluated in watch mode to avoid an issue in the typescript plugin (#3388) ### Pull Requests * [#3366](https://github.com/rollup/rollup/pull/3366): Correct spelling minifaction to minification (@VictorHom) * [#3371](https://github.com/rollup/rollup/pull/3371): Adjust bug template to mention REPL.it (@lukastaegert) * [#3388](https://github.com/rollup/rollup/pull/3388): Run transform hooks again in watch mode on files that errored (@lukastaegert) ## 1.31.0 *2020-01-31* ### Features * Always disable tree-shaking for asm.js functions to maintain semantics (#3362) ### Pull Requests * [#3362](https://github.com/rollup/rollup/pull/3362): Preserve asm.js code (@lukastaegert) ## 1.30.1 *2020-01-27* ### Bug Fixes * Do not mistreat static entgry points as dynamic ones when chunking (#3357) * Resolve a crash when chunking circular dynamic imports (#3357) ### Pull Requests * [#3357](https://github.com/rollup/rollup/pull/3357): Resolve issues with circular dynamic entries (@lukastaegert) ## 1.30.0 *2020-01-27* ### Features * Do not split chunks when dynamically imported modules import modules that are already loaded by all dynamic importers (#3354) * Add `hoistTransitiveImports` option to disable hoisting imports of static dependencies into entry chunks (#3353) ### Bug Fixes * Make sure polyfills are always loaded first when each static entry point contains them as first import (#3354) ### Pull Requests * [#3353](https://github.com/rollup/rollup/pull/3353): Add option to avoid hoisting transitive imports (@lukastaegert) * [#3354](https://github.com/rollup/rollup/pull/3354): Improve chunking algorithm for dynamic imports (@tjenkinson and @lukastaegert) ## 1.29.1 *2020-01-21* ### Bug Fixes * Avoid crashes for circular reexports when named exports cannot be found (#3350) ### Pull Requests * [#3335](https://github.com/rollup/rollup/pull/3335): Fix typo (@robbinworks) * [#3342](https://github.com/rollup/rollup/pull/3342): Remove ":" from test file names for Windows and update dependencies (@lukastaegert) * [#3350](https://github.com/rollup/rollup/pull/3350): Properly handle circular reexports (@lukastaegert) ## 1.29.0 *2020-01-08* ### Features * Enable top-level await by default (#3089) * Add typings for watch events (#3302) ### Bug Fixes * Deconflict files that would conflict only on a case-insensitive OS (#3317) * Do not fail in certain scenarios where a logical expression inside a sequence expression was being directly included (#3327) ### Pull Requests * [#3089](https://github.com/rollup/rollup/pull/3089): Move top-level await out of experimental (@guybedford) * [#3302](https://github.com/rollup/rollup/pull/3302): Adds type definitions for RollupWatcher events (@NotWoods) * [#3317](https://github.com/rollup/rollup/pull/3317): Fix module id conflict on a case insensitive OS (@yesmeck) * [#3327](https://github.com/rollup/rollup/pull/3327): Handle deoptimizations while a node is being included (@lukastaegert) ## 1.28.0 *2020-01-04* ### Features * Allow piping in stdin via the command line interface (#3312, #3290) * Allow plugins to mark modules as having syntheticNamedExports for e.g. better CJS interoperability (#3295) * Ignore variable reassignments in dead code when tree-shaking to remove more unneeded code (#3212) ### Bug Fixes * Properly respect tree-shaken code when generating sourcemaps (#3318) ### Pull Requests * [#3212](https://github.com/rollup/rollup/pull/3212): Handle assignments in dead code (@tjenkinson) * [#3290](https://github.com/rollup/rollup/pull/3290): Implement stdin input with optional "-" as the file name (@kzc) * [#3295](https://github.com/rollup/rollup/pull/3295): Add syntheticNamedExports (@manucorporat) * [#3300](https://github.com/rollup/rollup/pull/3300): Add note about setting `types` in tsconfig file (@tjenkinson) * [#3303](https://github.com/rollup/rollup/pull/3303): Use ! to assert not-null in TypeScript (@NotWoods) * [#3312](https://github.com/rollup/rollup/pull/3312): Implement stdin input (@lukastaegert) * [#3318](https://github.com/rollup/rollup/pull/3318): Update magic-string and other dependencies (@lukastaegert) ## 1.27.14 *2019-12-22* ### Bug Fixes * Update references to official rollup plugins in error messages (#3297, #3298) ### Pull Requests * [#3286](https://github.com/rollup/rollup/pull/3286): Update link to JavaScript API documentation (@romankaravia) * [#3294](https://github.com/rollup/rollup/pull/3294): Update deprecated references to the node-resolve plugin in the documentation (@Vlad-Shcherbina) * [#3297](https://github.com/rollup/rollup/pull/3297): Update references to rollup-plugin-json (@cprecioso) * [#3298](https://github.com/rollup/rollup/pull/3298): Update references to official rollup plugins (@cprecioso) ## 1.27.13 *2019-12-14* ### Bug Fixes * Do not truncate environment variable values at the first colon when using the `--environment` option (#3283) ### Pull Requests * [#3283](https://github.com/rollup/rollup/pull/3283): Allow environment variables to contain colons (@tlaverdure) ## 1.27.12 *2019-12-13* ### Bug Fixes * Prevent invalid AMD or SystemJS code when accessing `import.meta` (#3282) ### Pull Requests * [#3282](https://github.com/rollup/rollup/pull/3282): Always make "module" available for SystemJS and AMD formats if `import.meta` is accessed directly (@lukastaegert) ## 1.27.11 *2019-12-12* ### Bug Fixes * Resolve a crash due to an infinite loop (#3280) ### Pull Requests * [#3280](https://github.com/rollup/rollup/pull/3280): Prevent infinite deoptimizations (@lukastaegert) ## 1.27.10 *2019-12-11* ### Bug Fixes * Keep track of function return values in more situations (#3278) ### Pull Requests * [#3278](https://github.com/rollup/rollup/pull/3278): Avoid some unnecessary value tracking deoptimizations (@lukastaegert) ## 1.27.9 *2019-12-07* ### Bug Fixes * Fix an issue where reexports could be missing when preserving modules (#3273) * Allow turning of color output via NO_COLOR or FORCE_COLOR=0 environment variables (#3272) ### Pull Requests * [#3272](https://github.com/rollup/rollup/pull/3272): Support either NO_COLOR or FORCE_COLOR=0 to turn off color (@kikonen) * [#3273](https://github.com/rollup/rollup/pull/3273): Make sure that indirectly reexported modules also become chunk dependencies when preserving modules(@lukastaegert) ## 1.27.8 *2019-12-02* ### Bug Fixes * Deoptimize objects when a method is called on them to make sure modifications via "this" are observed (#3266) ### Pull Requests * [#3266](https://github.com/rollup/rollup/pull/3266): Workaround for various object literal mutation bugs (@kzc) ## 1.27.7 *2019-12-01* ### Bug Fixes * Fix a scenario where a reassignments to computed properties were not tracked (#3267) ### Pull Requests * [#3267](https://github.com/rollup/rollup/pull/3267): Fix incomplete computed property deoptimization (@lukastaegert) ## 1.27.6 *2019-11-30* ### Bug Fixes * Use "auto" export mode by default for all modules when preserving modules (#3265) * Observe "output.exports" when preserving modules and warn for mixed exports if necessary (#3265) ### Pull Requests * [#3265](https://github.com/rollup/rollup/pull/3265): Use export mode "auto" by default when preserving modules (@lukastaegert) ## 1.27.5 *2019-11-25* ### Bug Fixes * Make sure namespaces for inlined dynamic imports are treated as variable accesses when deconflicting (#3256) ### Pull Requests * [#3256](https://github.com/rollup/rollup/pull/3256): Avoid name conflicts when inlining dynamic imports nested in functions (@lukastaegert) * [#3257](https://github.com/rollup/rollup/pull/3257): Update dependencies (@lukastaegert) ## 1.27.4 *2019-11-22* ### Bug Fixes * Aggregate circular dependency warnings in the CLI (#3249) * Do not defer non-aggregated handlers in the CLI (#3249) ### Pull Requests * [#3249](https://github.com/rollup/rollup/pull/3249): Fix broken Windows CLI tests (@lukastaegert) * [#3251](https://github.com/rollup/rollup/pull/3251): Add installation as a separate header (@ashrith-kulai) ## 1.27.3 *2019-11-20* ### Bug Fixes * Provide better warning when empty chunks are created in a code-splitting scenario (#3244) ### Pull Requests * [#3244](https://github.com/rollup/rollup/pull/3244): Clearer empty chunk warning (@tjenkinson) ## 1.27.2 *2019-11-18* ### Bug Fixes * Fix an issue where live bindings were not working correctly when using `+=` in SystemJS (#3242) ### Pull Requests * [#3242](https://github.com/rollup/rollup/pull/3242): Export updated assignments when using shorthand update assignment expressions in SystemJS (@lukastaegert) ## 1.27.1 *2019-11-18* ### Bug Fixes * Fix an issue where code after a switch-statement with removed cases was erroneously not included (#3241) ### Pull Requests * [#3237](https://github.com/rollup/rollup/pull/3237): make `acornOptions` optional in `parse()` in docs (@tjenkinson) * [#3240](https://github.com/rollup/rollup/pull/3240): Update dependencies and fix vulnerability (@lukastaegert) * [#3241](https://github.com/rollup/rollup/pull/3241): Do not truncate after switch-statement with removed case (@lukastaegert) ## 1.27.0 *2019-11-12* ### Features * Add support for output-specific plugins (#3218) * Reenable parallel output processing when using the CLI (#3218) * Warn if files are emitted that would overwrite previously emitted files (#3218) ### Bug Fixes * Do not overwrite files emitted in other builds if outputs are generated in parallel (#3218) ### Pull Requests * [#3218](https://github.com/rollup/rollup/pull/3218): Per output plugins (@lukastaegert) ## 1.26.5 *2019-11-11* ### Bug Fixes * Fix a regression where it was no longer to pass a certain option format to generate (#3223) ### Pull Requests * [#3223](https://github.com/rollup/rollup/pull/3223): Allow passing input options to output (@lukastaegert) ## 1.26.4 *2019-11-09* ### Bug Fixes * Keep watching known files after a plugin error during the initial build (#3219) ### Pull Requests * [#3216](https://github.com/rollup/rollup/pull/3216): Fix small typo (@kaisermann) * [#3217](https://g