@rollup/plugin-commonjs 11.0.2 → 11.1.0
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 +18 -0
- package/README.md +27 -0
- package/dist/index.es.js +635 -209
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +632 -206
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/types/index.d.ts +55 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @rollup/plugin-commonjs ChangeLog
|
|
2
2
|
|
|
3
|
+
## v11.1.0
|
|
4
|
+
|
|
5
|
+
_2020-04-12_
|
|
6
|
+
|
|
7
|
+
### Bugfixes
|
|
8
|
+
|
|
9
|
+
- fix: produce legal variable names from filenames containing hyphens. (#201)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- feat: support dynamic require (#206)
|
|
14
|
+
- feat: export properties defined using Object.defineProperty(exports, ..) (#222)
|
|
15
|
+
|
|
16
|
+
### Updates
|
|
17
|
+
|
|
18
|
+
- chore: snapshot mismatch running tests before publish (d6bbfdd)
|
|
19
|
+
- test: add snapshots to all "function" tests (#218)
|
|
20
|
+
|
|
3
21
|
## v11.0.2
|
|
4
22
|
|
|
5
23
|
_2020-02-01_
|
package/README.md
CHANGED
|
@@ -44,6 +44,33 @@ Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#comma
|
|
|
44
44
|
|
|
45
45
|
## Options
|
|
46
46
|
|
|
47
|
+
### `dynamicRequireTargets`
|
|
48
|
+
|
|
49
|
+
Type: `String|Array[String]`<br>
|
|
50
|
+
Default: `[]`
|
|
51
|
+
|
|
52
|
+
Some modules contain dynamic `require` calls, or require modules that contain circular dependencies, which are not handled well by static imports.
|
|
53
|
+
Including those modules as `dynamicRequireTargets` will simulate a CommonJS (NodeJS-like) environment for them with support for dynamic and circular dependencies.
|
|
54
|
+
|
|
55
|
+
_Note: In extreme cases, this feature may result in some paths being rendered as absolute in the final bundle. The plugin tries to avoid exposing paths from the local machine, but if you are `dynamicRequirePaths` with paths that are far away from your project's folder, that may require replacing strings like `"/Users/John/Desktop/foo-project/"` -> `"/"`._
|
|
56
|
+
|
|
57
|
+
Example:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
commonjs({
|
|
61
|
+
dynamicRequireTargets: [
|
|
62
|
+
// include using a glob pattern (either a string or an array of strings)
|
|
63
|
+
'node_modules/logform/*.js',
|
|
64
|
+
|
|
65
|
+
// exclude files that are known to not be required dynamically, this allows for better optimizations
|
|
66
|
+
'!node_modules/logform/index.js',
|
|
67
|
+
'!node_modules/logform/format.js',
|
|
68
|
+
'!node_modules/logform/levels.js',
|
|
69
|
+
'!node_modules/logform/browser.js'
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
47
74
|
### `exclude`
|
|
48
75
|
|
|
49
76
|
Type: `String` | `Array[...String]`<br>
|