UNPKG

16 kBMarkdownView Raw
1# @rollup/plugin-commonjs ChangeLog
2
3## v21.0.2
4
5_2022-02-23_
6
7### Updates
8
9- chore: transpile dynamic helper to ES5 (#1082)
10
11## v21.0.1
12
13_2021-10-19_
14
15### Bugfixes
16
17- fix: pass on isEntry and custom resolve options (#1018)
18
19## v21.0.0
20
21_2021-10-01_
22
23### Breaking Changes
24
25- fix: use safe default value for ignoreTryCatch (#1005)
26
27## v20.0.0
28
29_2021-07-30_
30
31### Breaking Changes
32
33- fix: Correctly infer module name for any separator (#924)
34
35## v19.0.2
36
37_2021-07-26_
38
39### Bugfixes
40
41- fix convert module.exports with `__esModule` property(#939) (#942)
42
43## v19.0.1
44
45_2021-07-15_
46
47### Bugfixes
48
49- fix: short-circuit to actual module entry point when using circular ref through a different entry (#888)
50
51## v19.0.0
52
53_2021-05-07_
54
55### Breaking Changes
56
57- feat!: Add support for circular dependencies (#658)
58
59## v18.1.0
60
61_2021-05-04_
62
63### Bugfixes
64
65- fix: idempotence issue (#871)
66
67### Features
68
69- feat: Add `defaultIsModuleExports` option to match Node.js behavior (#838)
70
71## v18.0.0
72
73_2021-03-26_
74
75### Breaking Changes
76
77- feat!: Add ignore-dynamic-requires option (#819)
78
79### Bugfixes
80
81- fix: `isRestorableCompiledEsm` should also trigger code transform (#816)
82
83## v17.1.0
84
85_2021-01-29_
86
87### Bugfixes
88
89- fix: correctly replace shorthand `require` (#764)
90
91### Features
92
93- feature: load dynamic commonjs modules from es `import` (#766)
94- feature: support cache/resolve access inside dynamic modules (#728)
95- feature: allow keeping `require` calls inside try-catch (#729)
96
97### Updates
98
99- chore: fix lint error (#719)
100
101## v17.0.0
102
103_2020-11-30_
104
105### Breaking Changes
106
107- feat!: reconstruct real es module from \_\_esModule marker (#537)
108
109## v16.0.0
110
111_2020-10-27_
112
113### Breaking Changes
114
115- feat!: Expose cjs detection and support offline caching (#604)
116
117### Bugfixes
118
119- fix: avoid wrapping `commonjsRegister` call in `createCommonjsModule(...)` (#602)
120- fix: register dynamic modules when a different loader (i.e typescript) loads the entry file (#599)
121- fix: fixed access to node_modules dynamic module with subfolder (i.e 'logform/json') (#601)
122
123### Features
124
125- feat: pass type of import to node-resolve (#611)
126
127## v15.1.0
128
129_2020-09-21_
130
131### Features
132
133- feat: inject \_\_esModule marker into ES namespaces and add Object prototype (#552)
134- feat: add requireReturnsDefault to types (#579)
135
136## v15.0.0
137
138_2020-08-13_
139
140### Breaking Changes
141
142- feat!: return the namespace by default when requiring ESM (#507)
143- fix!: fix interop when importing CJS that is transpiled ESM from an actual ESM (#501)
144
145### Bugfixes
146
147- fix: add .cjs to default file extensions. (#524)
148
149### Updates
150
151- chore: update dependencies (fe399e2)
152
153## v14.0.0
154
155_2020-07-13_
156
157### Release Notes
158
159This restores the fixes from v13.0.1, but as a semver compliant major version.
160
161## v13.0.2
162
163_2020-07-13_
164
165### Rollback
166
167Rolls back breaking change in v13.0.1 whereby the exported `unwrapExports` method was removed.
168
169## v13.0.1
170
171_2020-07-12_
172
173### Bugfixes
174
175- fix: prevent rewrite require.resolve (#446)
176- fix: Support \_\_esModule packages with a default export (#465)
177
178## v13.0.0
179
180_2020-06-05_
181
182### Breaking Changes
183
184- fix!: remove namedExports from types (#410)
185- fix!: do not create fake named exports (#427)
186
187### Bugfixes
188
189- fix: \_\_moduleExports in multi entry + inter dependencies (#415)
190
191## v12.0.0
192
193_2020-05-20_
194
195### Breaking Changes
196
197- feat: add kill-switch for mixed es-cjs modules (#358)
198- feat: set syntheticNamedExports for commonjs modules (#149)
199
200### Bugfixes
201
202- fix: expose the virtual `require` function on mock `module`. fixes #307 (#326)
203- fix: improved shouldWrap logic. fixes #304 (#355)
204
205### Features
206
207- feat: support for explicit module.require calls. fixes #310 (#325)
208
209## v11.1.0
210
211_2020-04-12_
212
213### Bugfixes
214
215- fix: produce legal variable names from filenames containing hyphens. (#201)
216
217### Features
218
219- feat: support dynamic require (#206)
220- feat: export properties defined using Object.defineProperty(exports, ..) (#222)
221
222### Updates
223
224- chore: snapshot mismatch running tests before publish (d6bbfdd)
225- test: add snapshots to all "function" tests (#218)
226
227## v11.0.2
228
229_2020-02-01_
230
231### Updates
232
233- docs: fix link for plugin-node-resolve (#170)
234- chore: update dependencies (5405eea)
235- chore: remove jsnext:main (#152)
236
237## v11.0.1
238
239_2020-01-04_
240
241### Bugfixes
242
243- fix: module.exports object spread (#121)
244
245## 11.0.0
246
247_2019-12-13_
248
249- **Breaking:** Minimum compatible Rollup version is 1.20.0
250- **Breaking:** Minimum supported Node version is 8.0.0
251- Published as @rollup/plugin-commonjs
252
253## 10.1.0
254
255_2019-08-27_
256
257- Normalize ids before looking up in named export map ([#406](https://github.com/rollup/rollup-plugin-commonjs/issues/406))
258- Update README.md with note on symlinks ([#405](https://github.com/rollup/rollup-plugin-commonjs/issues/405))
259
260## 10.0.2
261
262_2019-08-03_
263
264- Support preserveSymlinks: false ([#401](https://github.com/rollup/rollup-plugin-commonjs/issues/401))
265
266## 10.0.1
267
268_2019-06-27_
269
270- Make tests run with Node 6 again and update dependencies ([#389](https://github.com/rollup/rollup-plugin-commonjs/issues/389))
271- Handle builtins appropriately for resolve 1.11.0 ([#395](https://github.com/rollup/rollup-plugin-commonjs/issues/395))
272
273## 10.0.0
274
275_2019-05-15_
276
277- Use new Rollup@1.12 context functions, fix issue when resolveId returns an object ([#387](https://github.com/rollup/rollup-plugin-commonjs/issues/387))
278
279## 9.3.4
280
281_2019-04-04_
282
283- Make "extensions" optional ([#384](https://github.com/rollup/rollup-plugin-commonjs/issues/384))
284- Use same typing for include and exclude properties ([#385](https://github.com/rollup/rollup-plugin-commonjs/issues/385))
285
286## 9.3.3
287
288_2019-04-04_
289
290- Remove colon from module prefixes ([#371](https://github.com/rollup/rollup-plugin-commonjs/issues/371))
291
292## 9.3.2
293
294_2019-04-04_
295
296- Use shared extractAssignedNames, fix destructuring issue ([#303](https://github.com/rollup/rollup-plugin-commonjs/issues/303))
297
298## 9.3.1
299
300_2019-04-04_
301
302- Include typings in release ([#382](https://github.com/rollup/rollup-plugin-commonjs/issues/382))
303
304## 9.3.0
305
306_2019-04-03_
307
308- Add TypeScript types ([#363](https://github.com/rollup/rollup-plugin-commonjs/issues/363))
309
310## 9.2.3
311
312_2019-04-02_
313
314- Improve support for ES3 browsers ([#364](https://github.com/rollup/rollup-plugin-commonjs/issues/364))
315- Add note about monorepo usage to readme ([#372](https://github.com/rollup/rollup-plugin-commonjs/issues/372))
316- Add .js extension to generated helper file ([#373](https://github.com/rollup/rollup-plugin-commonjs/issues/373))
317
318## 9.2.2
319
320_2019-03-25_
321
322- Handle array destructuring assignment ([#379](https://github.com/rollup/rollup-plugin-commonjs/issues/379))
323
324## 9.2.1
325
326_2019-02-23_
327
328- Use correct context when manually resolving ids ([#370](https://github.com/rollup/rollup-plugin-commonjs/issues/370))
329
330## 9.2.0
331
332_2018-10-10_
333
334- Fix missing default warning, produce better code when importing known ESM default exports ([#349](https://github.com/rollup/rollup-plugin-commonjs/issues/349))
335- Refactor code and add prettier ([#346](https://github.com/rollup/rollup-plugin-commonjs/issues/346))
336
337## 9.1.8
338
339_2018-09-18_
340
341- Ignore virtual modules created by other plugins ([#327](https://github.com/rollup/rollup-plugin-commonjs/issues/327))
342- Add "location" and "process" to reserved words ([#330](https://github.com/rollup/rollup-plugin-commonjs/issues/330))
343
344## 9.1.6
345
346_2018-08-24_
347
348- Keep commonJS detection between instantiations ([#338](https://github.com/rollup/rollup-plugin-commonjs/issues/338))
349
350## 9.1.5
351
352_2018-08-09_
353
354- Handle object form of input ([#329](https://github.com/rollup/rollup-plugin-commonjs/issues/329))
355
356## 9.1.4
357
358_2018-07-27_
359
360- Make "from" a reserved word ([#320](https://github.com/rollup/rollup-plugin-commonjs/issues/320))
361
362## 9.1.3
363
364_2018-04-30_
365
366- Fix a caching issue ([#316](https://github.com/rollup/rollup-plugin-commonjs/issues/316))
367
368## 9.1.2
369
370_2018-04-30_
371
372- Re-publication of 9.1.0
373
374## 9.1.1
375
376_2018-04-30_
377
378- Fix ordering of modules when using rollup 0.58 ([#302](https://github.com/rollup/rollup-plugin-commonjs/issues/302))
379
380## 9.1.0
381
382- Do not automatically wrap modules with return statements in top level arrow functions ([#302](https://github.com/rollup/rollup-plugin-commonjs/issues/302))
383
384## 9.0.0
385
386- Make rollup a peer dependency with a version range ([#300](https://github.com/rollup/rollup-plugin-commonjs/issues/300))
387
388## 8.4.1
389
390- Re-release of 8.3.0 as #287 was actually a breaking change
391
392## 8.4.0
393
394- Better handle non-CJS files that contain CJS keywords ([#285](https://github.com/rollup/rollup-plugin-commonjs/issues/285))
395- Use rollup's plugin context`parse` function ([#287](https://github.com/rollup/rollup-plugin-commonjs/issues/287))
396- Improve error handling ([#288](https://github.com/rollup/rollup-plugin-commonjs/issues/288))
397
398## 8.3.0
399
400- Handle multiple entry points ([#283](https://github.com/rollup/rollup-plugin-commonjs/issues/283))
401- Extract named exports from exported object literals ([#272](https://github.com/rollup/rollup-plugin-commonjs/issues/272))
402- Fix when `options.external` is modified by other plugins ([#264](https://github.com/rollup/rollup-plugin-commonjs/issues/264))
403- Recognize static template strings in require statements ([#271](https://github.com/rollup/rollup-plugin-commonjs/issues/271))
404
405## 8.2.4
406
407- Don't import default from ES modules that don't export default ([#206](https://github.com/rollup/rollup-plugin-commonjs/issues/206))
408
409## 8.2.3
410
411- Prevent duplicate default exports ([#230](https://github.com/rollup/rollup-plugin-commonjs/pull/230))
412- Only include default export when it exists ([#226](https://github.com/rollup/rollup-plugin-commonjs/pull/226))
413- Deconflict `require` aliases ([#232](https://github.com/rollup/rollup-plugin-commonjs/issues/232))
414
415## 8.2.1
416
417- Fix magic-string deprecation warning
418
419## 8.2.0
420
421- Avoid using `index` as a variable name ([#208](https://github.com/rollup/rollup-plugin-commonjs/pull/208))
422
423## 8.1.1
424
425- Compatibility with 0.48 ([#220](https://github.com/rollup/rollup-plugin-commonjs/issues/220))
426
427## 8.1.0
428
429- Handle `options.external` correctly ([#212](https://github.com/rollup/rollup-plugin-commonjs/pull/212))
430- Support top-level return ([#195](https://github.com/rollup/rollup-plugin-commonjs/pull/195))
431
432## 8.0.2
433
434- Fix another `var` rewrite bug ([#181](https://github.com/rollup/rollup-plugin-commonjs/issues/181))
435
436## 8.0.1
437
438- Remove declarators within a var declaration correctly ([#179](https://github.com/rollup/rollup-plugin-commonjs/issues/179))
439
440## 8.0.0
441
442- Prefer the names dependencies are imported by for the common `var foo = require('foo')` pattern ([#176](https://github.com/rollup/rollup-plugin-commonjs/issues/176))
443
444## 7.1.0
445
446- Allow certain `require` statements to pass through unmolested ([#174](https://github.com/rollup/rollup-plugin-commonjs/issues/174))
447
448## 7.0.2
449
450- Handle duplicate default exports ([#158](https://github.com/rollup/rollup-plugin-commonjs/issues/158))
451
452## 7.0.1
453
454- Fix exports with parentheses ([#168](https://github.com/rollup/rollup-plugin-commonjs/issues/168))
455
456## 7.0.0
457
458- Rewrite `typeof module`, `typeof module.exports` and `typeof exports` as `'object'` ([#151](https://github.com/rollup/rollup-plugin-commonjs/issues/151))
459
460## 6.0.1
461
462- Don't overwrite globals ([#127](https://github.com/rollup/rollup-plugin-commonjs/issues/127))
463
464## 6.0.0
465
466- Rewrite top-level `define` as `undefined`, so AMD-first UMD blocks do not cause breakage ([#144](https://github.com/rollup/rollup-plugin-commonjs/issues/144))
467- Support ES2017 syntax ([#132](https://github.com/rollup/rollup-plugin-commonjs/issues/132))
468- Deconflict exported reserved keywords ([#116](https://github.com/rollup/rollup-plugin-commonjs/issues/116))
469
470## 5.0.5
471
472- Fix parenthesis wrapped exports ([#120](https://github.com/rollup/rollup-plugin-commonjs/issues/120))
473
474## 5.0.4
475
476- Ensure named exports are added to default export in optimised modules ([#112](https://github.com/rollup/rollup-plugin-commonjs/issues/112))
477
478## 5.0.3
479
480- Respect custom `namedExports` in optimised modules ([#35](https://github.com/rollup/rollup-plugin-commonjs/issues/35))
481
482## 5.0.2
483
484- Replace `require` (outside call expressions) with `commonjsRequire` helper ([#77](https://github.com/rollup/rollup-plugin-commonjs/issues/77), [#83](https://github.com/rollup/rollup-plugin-commonjs/issues/83))
485
486## 5.0.1
487
488- Deconflict against globals ([#84](https://github.com/rollup/rollup-plugin-commonjs/issues/84))
489
490## 5.0.0
491
492- Optimise modules that don't need to be wrapped in a function ([#106](https://github.com/rollup/rollup-plugin-commonjs/pull/106))
493- Ignore modules containing `import` and `export` statements ([#96](https://github.com/rollup/rollup-plugin-commonjs/pull/96))
494
495## 4.1.0
496
497- Ignore dead branches ([#93](https://github.com/rollup/rollup-plugin-commonjs/issues/93))
498
499## 4.0.1
500
501- Fix `ignoreGlobal` option ([#86](https://github.com/rollup/rollup-plugin-commonjs/pull/86))
502
503## 4.0.0
504
505- Better interop and smaller output ([#92](https://github.com/rollup/rollup-plugin-commonjs/pull/92))
506
507## 3.3.1
508
509- Deconflict export and local module ([rollup/rollup#554](https://github.com/rollup/rollup/issues/554))
510
511## 3.3.0
512
513- Keep the order of execution for require calls ([#43](https://github.com/rollup/rollup-plugin-commonjs/pull/43))
514- Use interopDefault as helper ([#42](https://github.com/rollup/rollup-plugin-commonjs/issues/42))
515
516## 3.2.0
517
518- Use named exports as a function when no default export is defined ([#524](https://github.com/rollup/rollup/issues/524))
519
520## 3.1.0
521
522- Replace `typeof require` with `'function'` ([#38](https://github.com/rollup/rollup-plugin-commonjs/issues/38))
523- Don't attempt to resolve entry file relative to importer ([#63](https://github.com/rollup/rollup-plugin-commonjs/issues/63))
524
525## 3.0.2
526
527- Handle multiple references to `global`
528
529## 3.0.1
530
531- Return a `name`
532
533## 3.0.0
534
535- Make `transform` stateless ([#71](https://github.com/rollup/rollup-plugin-commonjs/pull/71))
536- Support web worker `global` ([#50](https://github.com/rollup/rollup-plugin-commonjs/issues/50))
537- Ignore global with `options.ignoreGlobal` ([#48](https://github.com/rollup/rollup-plugin-commonjs/issues/48))
538
539## 2.2.1
540
541- Prevent false positives with `namedExports` ([#36](https://github.com/rollup/rollup-plugin-commonjs/issues/36))
542
543## 2.2.0
544
545- Rewrite top-level `this` expressions to mean the same as `global` ([#31](https://github.com/rollup/rollup-plugin-commonjs/issues/31))
546
547## 2.1.0
548
549- Optimised module wrappers ([#20](https://github.com/rollup/rollup-plugin-commonjs/pull/20))
550- Allow control over named exports via `options.namedExports` ([#18](https://github.com/rollup/rollup-plugin-commonjs/issues/18))
551- Handle bare imports correctly ([#23](https://github.com/rollup/rollup-plugin-commonjs/issues/23))
552- Blacklist all reserved words as export names ([#21](https://github.com/rollup/rollup-plugin-commonjs/issues/21))
553- Configure allowed file extensions via `options.extensions` ([#27](https://github.com/rollup/rollup-plugin-commonjs/pull/27))
554
555## 2.0.0
556
557- Support for transpiled modules – `exports.default` is used as the default export in place of `module.exports`, if applicable, and `__esModule` is not exported ([#16](https://github.com/rollup/rollup-plugin-commonjs/pull/16))
558
559## 1.4.0
560
561- Generate sourcemaps by default
562
563## 1.3.0
564
565- Handle references to `global` ([#6](https://github.com/rollup/rollup-plugin-commonjs/issues/6))
566
567## 1.2.0
568
569- Generate named exports where possible ([#5](https://github.com/rollup/rollup-plugin-commonjs/issues/5))
570- Handle shadowed `require`/`module`/`exports`
571
572## 1.1.0
573
574- Handle dots in filenames ([#3](https://github.com/rollup/rollup-plugin-commonjs/issues/3))
575- Wrap modules in IIFE for more readable output
576
577## 1.0.0
578
579- Stable release, now that Rollup supports plugins
580
581## 0.2.1
582
583- Allow mixed CommonJS/ES6 imports/exports
584- Use `var` instead of `let`
585
586## 0.2.0
587
588- Sourcemap support
589- Support `options.include` and `options.exclude`
590- Bail early if module is obviously not a CommonJS module
591
592## 0.1.1
593
594Add dist files to package (whoops!)
595
596## 0.1.0
597
598- First release