ncc
Simple CLI for compiling a Node.js module into a single file,
together with all its dependencies, gcc-style.
webpack changes
Fixed a bug where webpack was setting require
to undefined
if a program tries to override require
with an if
statement:
https://github.com/felixge/node-formidable/issues/337
Change in webpack/lib/dependencies/CommonJsPlugin.js
:
+ //parser.hooks.assign.for("require").tap("CommonJsPlugin", expr => {
+ //// to not leak to global "require", we need to define a local require here.
+ //const dep = new ConstDependency("var require;", 0);
+ //dep.loc = expr.loc;
+ //parser.state.current.addDependency(dep);
+ //parser.scope.definitions.add("require");
+ //return true;
+ //});
Known issues
- Side-effects from above change are unknown
- Minification breaks
- FS inlining is not implemented
Motivation
ncc
allows for using and testing rollup quickly, without
special configuration.
Usage
CLI
$ ncc input.js -o bundle.js
Node.js
require('@zeit/ncc')('/path/to/input', {
minify: true // default
}).then(bundle => {
// result of rollup `bundle.generate()` call
console.log(bundle.code)
})
Current Tags
77 Versions
-
0.22.3
[deprecated]
...
4 years ago
-
0.22.2
[deprecated]
...
4 years ago
-
0.22.1
[deprecated]
...
5 years ago
-
0.22.0
[deprecated]
...
5 years ago
-
0.21.1
[deprecated]
...
5 years ago
-
0.21.0
[deprecated]
...
5 years ago
-
0.20.5
[deprecated]
...
5 years ago
-
0.20.4
[deprecated]
...
5 years ago
-
0.20.3
[deprecated]
...
5 years ago
-
0.20.2
[deprecated]
...
5 years ago
-
0.20.1
[deprecated]
...
5 years ago
-
0.20.0
[deprecated]
...
5 years ago
-
0.19.1
[deprecated]
...
5 years ago
-
0.19.0
[deprecated]
...
5 years ago
-
0.19.0-beta.1
...
5 years ago
-
0.18.5
[deprecated]
...
6 years ago
-
0.18.4
[deprecated]
...
6 years ago
-
0.18.3
[deprecated]
...
6 years ago
-
0.18.2
[deprecated]
...
6 years ago
-
0.18.1
[deprecated]
...
6 years ago
-
0.18.0
[deprecated]
...
6 years ago
-
0.17.4
[deprecated]
...
6 years ago
-
0.17.3
[deprecated]
...
6 years ago
-
0.17.2
[deprecated]
...
6 years ago
-
0.17.1
[deprecated]
...
6 years ago
-
0.17.0
[deprecated]
...
6 years ago
-
0.16.1
[deprecated]
...
6 years ago
-
0.16.0
[deprecated]
...
6 years ago
-
0.15.2
[deprecated]
...
6 years ago
-
0.15.1
[deprecated]
...
6 years ago
-
0.15.0
[deprecated]
...
6 years ago
-
0.14.0
[deprecated]
...
6 years ago
-
0.13.3
[deprecated]
...
6 years ago
-
0.13.2
[deprecated]
...
6 years ago
-
0.13.1
[deprecated]
...
6 years ago
-
0.13.0
[deprecated]
...
6 years ago
-
0.12.1
[deprecated]
...
6 years ago
-
0.12.0
[deprecated]
...
6 years ago
-
0.11.0
[deprecated]
...
6 years ago
-
0.9.0
[deprecated]
...
6 years ago
-
0.8.1
[deprecated]
...
6 years ago
-
0.8.0
[deprecated]
...
6 years ago
-
0.7.0
[deprecated]
...
6 years ago
-
0.6.0
[deprecated]
...
6 years ago
-
0.5.5
[deprecated]
...
6 years ago
-
0.5.4
[deprecated]
...
6 years ago
-
0.5.3
[deprecated]
...
6 years ago
-
0.5.2
[deprecated]
...
6 years ago
-
0.5.1
[deprecated]
...
6 years ago
-
0.5.0
[deprecated]
...
6 years ago
-
0.4.1
[deprecated]
...
6 years ago
-
0.4.0
[deprecated]
...
6 years ago
-
0.3.0
[deprecated]
...
6 years ago
-
0.2.1
[deprecated]
...
6 years ago
-
0.2.0
[deprecated]
...
6 years ago
-
0.1.18
[deprecated]
...
6 years ago
-
0.1.17
[deprecated]
...
6 years ago
-
0.1.16
[deprecated]
...
6 years ago
-
0.1.15
[deprecated]
...
6 years ago
-
0.1.14
[deprecated]
...
6 years ago
-
0.1.13
[deprecated]
...
6 years ago
-
0.1.12
[deprecated]
...
6 years ago
-
0.1.11
[deprecated]
...
6 years ago
-
0.1.10
[deprecated]
...
6 years ago
-
0.1.9
[deprecated]
...
6 years ago
-
0.1.8
[deprecated]
...
6 years ago
-
0.1.7
[deprecated]
...
6 years ago
-
0.1.6
[deprecated]
...
6 years ago
-
0.1.5-webpack
...
6 years ago
-
0.1.4-webpack
...
6 years ago
-
0.1.3-webpack
...
6 years ago
-
0.1.2-webpack
...
6 years ago
-
0.1.1-webpack
...
6 years ago
-
0.0.4
[deprecated]
...
6 years ago
-
0.0.3
[deprecated]
...
6 years ago
-
0.0.2
[deprecated]
...
6 years ago
-
0.0.1
[deprecated]
...
6 years ago