Skip to content

Commit 911517f

Browse files
committed
formatting, license
1 parent 14b42ac commit 911517f

15 files changed

Lines changed: 78 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ However `webpack` has big differences:
218218
`webpack` replaces module names and paths with numbers. `webmake` don't do that and do resolves requires on client-side.
219219
This design of `webmake` was intended to support variables as arguments to require calls.
220220
`webpack` resolves requires in compile time and have no resolve code on client side. This results in smaller bundles.
221-
Variables as argments will be handled different and with more limitations.
221+
Variables as argments will be handled different and with more limitations in `webpack`.
222222

223223
Another limitation in `webmake` which are based on the previous one is that modules must be in the current package scope.
224224
In `webpack` this is not a restriction.
225225

226+
There is no `require.context` in `webmake`. Therefore there is a forced include list in options which allows modules to be required even if the names were not available at compile time.
227+
226228
The design of `webmake` causes all modules with the same name to overlap.
227229
This can be problematic if different submodules rely on specific versions of the same module.
228230
The behaivior also differs from the behaivior of node.js, because node.js installs a module for each instance in submodules and `webmake` cause them the merge into a single module which is only installed once.
@@ -232,10 +234,11 @@ But in `webpack` this can (currently) cause duplicate code if a module is used i
232234
I want to face this issue (TODO).
233235

234236
`webmake` do (currently) not support Code Splitting.
237+
But medikoo said he works at some related feature.
235238

236239
## Tests
237240

238-
You can run the unit tests which `node_modules/.bin/vows`.
241+
You can run the unit tests with `npm test`.
239242

240243
You can run the browser tests:
241244

@@ -256,4 +259,4 @@ You are also welcome to correct any spelling mistakes or any language issues, be
256259

257260
## License
258261

259-
MIT
262+
MIT (http://www.opensource.org/licenses/mit-license.php)

‎bin/webpack.js‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
#!/usr/bin/env node
22

3+
/*
4+
MIT License http://www.opensource.org/licenses/mit-license.php
5+
Author Tobias Koppers @sokra
6+
*/
37
var path = require("path");
48
var fs = require("fs");
59
var argv = require("optimist")
610
.usage("Usage: $0 <input> <output>")
7-
11+
812
.boolean("single")
913
.describe("single", "Disable Code Splitting")
1014
.default("single", false)
11-
15+
1216
.boolean("min")
1317
.describe("min", "Minimize it with uglifyjs")
1418
.default("min", false)
15-
19+
1620
.boolean("filenames")
1721
.describe("filenames", "Output Filenames Into File")
1822
.default("filenames", false)
19-
23+
2024
.string("options")
2125
.describe("options", "Options JSON File")
22-
26+
2327
.string("script-src-prefix")
2428
.describe("script-src-prefix", "Path Prefix For JavaScript Loading")
25-
29+
2630
.string("libary")
2731
.describe("libary", "Stores the exports into this variable")
28-
32+
2933
.demand(1)
3034
.argv;
3135

‎examples/code-splitted-require.context/build.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var cp = require('child_process');
26

37
var argv = process.argv;

‎examples/code-splitting/build.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var cp = require('child_process');
26

37
var argv = process.argv;

‎examples/require.context/build.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var cp = require('child_process');
26

37
var argv = process.argv;

‎lib/buildDeps.js‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var parse = require("./parse");
26
var resolve = require("./resolve");
37
var fs = require("fs");
@@ -218,10 +222,10 @@ function addContextModule(depTree, context, contextModuleName, options, callback
218222
extensionsAccess.push(ext.replace(/"/g, "\\\""));
219223
extensionsAccess.push("\"]");
220224
});
221-
222-
contextModule.source = "/***/module.exports = function(name) {\n" +
223-
"/***/\tvar map = " + JSON.stringify(contextModule.requireMap) + ";\n" +
224-
"/***/\treturn require(map[name]" + extensionsAccess.join("") + ");\n" +
225+
226+
contextModule.source = "/***/module.exports = function(name) {\n" +
227+
"/***/\tvar map = " + JSON.stringify(contextModule.requireMap) + ";\n" +
228+
"/***/\treturn require(map[name]" + extensionsAccess.join("") + ");\n" +
225229
"/***/};";
226230
callback(null, contextModule.id);
227231
});

‎lib/parse.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var esprima = require("esprima");
26

37
// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API

‎lib/resolve.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var path = require("path");
26
var fs = require("fs");
37

‎lib/webpack.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var buildDeps = require("./buildDeps");
26
var path = require("path");
37
var writeChunk = require("./writeChunk");
@@ -10,11 +14,11 @@ var templateSingle = require("fs").readFileSync(path.join(__dirname, "templateSi
1014
webpack(context, moduleName, callback);
1115
webpack(absoluteModulePath, options, callback);
1216
webpack(absoluteModulePath, callback);
13-
17+
1418
callback: function(err, source / stats)
1519
source if options.output is not set
1620
else stats json
17-
21+
1822
options:
1923
- outputJsonpFunction
2024
JSONP function used to load chunks

‎lib/writeChunk.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
MIT License http://www.opensource.org/licenses/mit-license.php
3+
Author Tobias Koppers @sokra
4+
*/
15
var writeSource = require("./writeSource");
26

37
module.exports = function(depTree, chunk, options) {

0 commit comments

Comments
 (0)