@rollup/plugin-commonjs 11.1.0 → 13.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +5 -39
- package/dist/index.es.js +231 -192
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +229 -190
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/types/index.d.ts +3 -4
- package/LICENSE +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @rollup/plugin-commonjs ChangeLog
|
|
2
2
|
|
|
3
|
+
## v13.0.2
|
|
4
|
+
|
|
5
|
+
_2020-07-13_
|
|
6
|
+
|
|
7
|
+
### Rollback
|
|
8
|
+
|
|
9
|
+
Rolls back breaking change in v13.0.1 whereby the exported `unwrapExports` method was removed.
|
|
10
|
+
|
|
11
|
+
## v13.0.1
|
|
12
|
+
|
|
13
|
+
_2020-07-12_
|
|
14
|
+
|
|
15
|
+
### Bugfixes
|
|
16
|
+
|
|
17
|
+
- fix: prevent rewrite require.resolve (#446)
|
|
18
|
+
- fix: Support \_\_esModule packages with a default export (#465)
|
|
19
|
+
|
|
20
|
+
## v13.0.0
|
|
21
|
+
|
|
22
|
+
_2020-06-05_
|
|
23
|
+
|
|
24
|
+
### Breaking Changes
|
|
25
|
+
|
|
26
|
+
- fix!: remove namedExports from types (#410)
|
|
27
|
+
- fix!: do not create fake named exports (#427)
|
|
28
|
+
|
|
29
|
+
### Bugfixes
|
|
30
|
+
|
|
31
|
+
- fix: \_\_moduleExports in multi entry + inter dependencies (#415)
|
|
32
|
+
|
|
33
|
+
## v12.0.0
|
|
34
|
+
|
|
35
|
+
_2020-05-20_
|
|
36
|
+
|
|
37
|
+
### Breaking Changes
|
|
38
|
+
|
|
39
|
+
- feat: add kill-switch for mixed es-cjs modules (#358)
|
|
40
|
+
- feat: set syntheticNamedExports for commonjs modules (#149)
|
|
41
|
+
|
|
42
|
+
### Bugfixes
|
|
43
|
+
|
|
44
|
+
- fix: expose the virtual `require` function on mock `module`. fixes #307 (#326)
|
|
45
|
+
- fix: improved shouldWrap logic. fixes #304 (#355)
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
- feat: support for explicit module.require calls. fixes #310 (#325)
|
|
50
|
+
|
|
3
51
|
## v11.1.0
|
|
4
52
|
|
|
5
53
|
_2020-04-12_
|
package/README.md
CHANGED
|
@@ -106,46 +106,12 @@ Default: `true`
|
|
|
106
106
|
|
|
107
107
|
If false, skips source map generation for CommonJS modules.
|
|
108
108
|
|
|
109
|
-
### `
|
|
109
|
+
### `transformMixedEsModules`
|
|
110
110
|
|
|
111
|
-
Type: `
|
|
112
|
-
Default: `
|
|
113
|
-
|
|
114
|
-
Explicitly specify unresolvable named exports.
|
|
115
|
-
|
|
116
|
-
This plugin will attempt to create named exports, where appropriate, so you can do this...
|
|
117
|
-
|
|
118
|
-
```js
|
|
119
|
-
// importer.js
|
|
120
|
-
import { named } from './exporter.js';
|
|
121
|
-
|
|
122
|
-
// exporter.js
|
|
123
|
-
module.exports = { named: 42 }; // or `exports.named = 42;`
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
...but that's not always possible:
|
|
127
|
-
|
|
128
|
-
```js
|
|
129
|
-
// importer.js
|
|
130
|
-
import { named } from 'my-lib';
|
|
131
|
-
|
|
132
|
-
// my-lib.js
|
|
133
|
-
var myLib = exports;
|
|
134
|
-
myLib.named = "you can't see me";
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
In those cases, you can specify custom named exports:
|
|
111
|
+
Type: `Boolean`<br>
|
|
112
|
+
Default: `false`
|
|
138
113
|
|
|
139
|
-
|
|
140
|
-
commonjs({
|
|
141
|
-
namedExports: {
|
|
142
|
-
// left-hand side can be an absolute path, a path
|
|
143
|
-
// relative to the current directory, or the name
|
|
144
|
-
// of a module in node_modules
|
|
145
|
-
'my-lib': ['named']
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
```
|
|
114
|
+
Instructs the plugin whether or not to enable mixed module transformations. This is useful in scenarios with mixed ES and CommonJS modules. Set to `true` if it's known that `require` calls should be transformed, or `false` if the code contains env detection and the `require` should survive a transformation.
|
|
149
115
|
|
|
150
116
|
### `ignore`
|
|
151
117
|
|
|
@@ -156,7 +122,7 @@ Sometimes you have to leave require statements unconverted. Pass an array contai
|
|
|
156
122
|
|
|
157
123
|
## Using with @rollup/plugin-node-resolve
|
|
158
124
|
|
|
159
|
-
Since most CommonJS packages you are importing are probably
|
|
125
|
+
Since most CommonJS packages you are importing are probably dependencies in `node_modules`, you may need to use [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve):
|
|
160
126
|
|
|
161
127
|
```js
|
|
162
128
|
// rollup.config.js
|