Renamed *libary* to *library*
Conflicts: test/browsertest/build.js
This commit is contained in:
parent
cbf909e9db
commit
0366444379
|
@ -2,3 +2,4 @@
|
||||||
/test/js
|
/test/js
|
||||||
/test/browsertest/js
|
/test/browsertest/js
|
||||||
/examples/*/js
|
/examples/*/js
|
||||||
|
.DS_Store
|
|
@ -326,7 +326,7 @@ Options:
|
||||||
--filenames Output Filenames Into File [boolean] [default: false]
|
--filenames Output Filenames Into File [boolean] [default: false]
|
||||||
--options Options JSON File [string]
|
--options Options JSON File [string]
|
||||||
--public-prefix Path Prefix For JavaScript Loading [string]
|
--public-prefix Path Prefix For JavaScript Loading [string]
|
||||||
--libary Stores the exports into this variable [string]
|
--library Stores the exports into this variable [string]
|
||||||
--colors Output Stats with colors [boolean] [default: false]
|
--colors Output Stats with colors [boolean] [default: false]
|
||||||
--single Disable lazy loading [boolean] [default: false]
|
--single Disable lazy loading [boolean] [default: false]
|
||||||
--json Output Stats as JSON [boolean] [default: false]
|
--json Output Stats as JSON [boolean] [default: false]
|
||||||
|
@ -376,9 +376,9 @@ You can also save this options object in a JSON file and use it with the shell c
|
||||||
// path to create the chunks url relative to page
|
// path to create the chunks url relative to page
|
||||||
// deprecated name: scriptSrcPrefix
|
// deprecated name: scriptSrcPrefix
|
||||||
|
|
||||||
libary: "mylib", // default: null
|
library: "mylib", // default: null
|
||||||
// store the exports of the entrace module in a variable of this name
|
// store the exports of the entrace module in a variable of this name
|
||||||
// use this to create a libary from webpack
|
// use this to create a library from webpack
|
||||||
|
|
||||||
includeFilenames: true, // default: false
|
includeFilenames: true, // default: false
|
||||||
// include the filename of each module as comment before the module
|
// include the filename of each module as comment before the module
|
||||||
|
|
|
@ -33,8 +33,8 @@ var argv = require("optimist")
|
||||||
.string("public-prefix")
|
.string("public-prefix")
|
||||||
.describe("public-prefix", "Path Prefix For JavaScript Loading")
|
.describe("public-prefix", "Path Prefix For JavaScript Loading")
|
||||||
|
|
||||||
.string("libary")
|
.string("library")
|
||||||
.describe("libary", "Stores the exports into this variable")
|
.describe("library", "Stores the exports into this variable")
|
||||||
|
|
||||||
.boolean("colors")
|
.boolean("colors")
|
||||||
.describe("colors", "Output Stats with colors")
|
.describe("colors", "Output Stats with colors")
|
||||||
|
@ -145,8 +145,8 @@ if(argv.filenames) {
|
||||||
options.includeFilenames = true;
|
options.includeFilenames = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argv.libary) {
|
if(argv.library) {
|
||||||
options.libary = argv.libary;
|
options.library = argv.library;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argv.alias) {
|
if(argv.alias) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ module.exports = function webpackMain(context, moduleName, options, callback) {
|
||||||
if(!options.events) options.events = new (require("events").EventEmitter)();
|
if(!options.events) options.events = new (require("events").EventEmitter)();
|
||||||
|
|
||||||
if(!options.outputJsonpFunction)
|
if(!options.outputJsonpFunction)
|
||||||
options.outputJsonpFunction = "webpackJsonp" + (options.libary || "");
|
options.outputJsonpFunction = "webpackJsonp" + (options.library || "");
|
||||||
options.publicPrefix = options.publicPrefix || "";
|
options.publicPrefix = options.publicPrefix || "";
|
||||||
|
|
||||||
options.context = options.context || context;
|
options.context = options.context || context;
|
||||||
|
@ -282,7 +282,7 @@ function webpack(context, moduleName, options, callback) {
|
||||||
var hash;
|
var hash;
|
||||||
try {
|
try {
|
||||||
hash = new (require("crypto").Hash)("md5");
|
hash = new (require("crypto").Hash)("md5");
|
||||||
hash.update(JSON.stringify(options.libary || ""));
|
hash.update(JSON.stringify(options.library || ""));
|
||||||
hash.update(JSON.stringify(options.outputPostfix));
|
hash.update(JSON.stringify(options.outputPostfix));
|
||||||
hash.update(JSON.stringify(options.outputJsonpFunction));
|
hash.update(JSON.stringify(options.outputJsonpFunction));
|
||||||
hash.update(JSON.stringify(options.publicPrefix));
|
hash.update(JSON.stringify(options.publicPrefix));
|
||||||
|
@ -320,10 +320,10 @@ function webpack(context, moduleName, options, callback) {
|
||||||
else
|
else
|
||||||
hash = "";
|
hash = "";
|
||||||
|
|
||||||
// if it should be a libary, we prepend a variable name
|
// if it should be a library, we prepend a variable name
|
||||||
if(options.libary) {
|
if(options.library) {
|
||||||
buffer.push("/******/var ");
|
buffer.push("/******/var ");
|
||||||
buffer.push(options.libary);
|
buffer.push(options.library);
|
||||||
buffer.push("=\n");
|
buffer.push("=\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,11 @@ console.log("compile scripts...");
|
||||||
var extraArgsNoWatch = extraArgs.slice(0);
|
var extraArgsNoWatch = extraArgs.slice(0);
|
||||||
var watchIndex = extraArgsNoWatch.indexOf("--watch");
|
var watchIndex = extraArgsNoWatch.indexOf("--watch");
|
||||||
if(watchIndex != -1) extraArgsNoWatch.splice(watchIndex, 1);
|
if(watchIndex != -1) extraArgsNoWatch.splice(watchIndex, 1);
|
||||||
// node ../../bin/webpack --colors --single --libary libary1 node_modules/libary1 js/libary1.js
|
// node ../../bin/webpack --colors --single --library library1 node_modules/library1 js/library1.js
|
||||||
var libary1 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--single", "--libary", "libary1",
|
var library1 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--single", "--library", "library1",
|
||||||
"node_modules/libary1", "js/libary1.js"], extraArgsNoWatch));
|
"node_modules/library1", "js/library1.js"], extraArgsNoWatch));
|
||||||
bindOutput(libary1);
|
bindOutput(library1);
|
||||||
libary1.on("exit", function(code) {
|
library1.on("exit", function(code) {
|
||||||
if(code === 0) {
|
if(code === 0) {
|
||||||
// node ../../bin/webpack --colors --alias vm=vm-browserify --workers --public-prefix js/ lib/index js/web.js
|
// node ../../bin/webpack --colors --alias vm=vm-browserify --workers --public-prefix js/ lib/index js/web.js
|
||||||
var main = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--alias", "vm=vm-browserify", "--workers",
|
var main = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--alias", "vm=vm-browserify", "--workers",
|
||||||
|
@ -40,6 +40,6 @@ libary1.on("exit", function(code) {
|
||||||
bindOutput(main);
|
bindOutput(main);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var libary2 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--libary", "libary2",
|
var library2 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--library", "library2",
|
||||||
"--public-prefix", "js/", "--options", "libary2config.js", "node_modules/libary2", "js/libary2.js"], extraArgsNoWatch));
|
"--public-prefix", "js/", "--options", "library2config.js", "node_modules/library2", "js/library2.js"], extraArgsNoWatch));
|
||||||
bindOutput(libary2);
|
bindOutput(library2);
|
||||||
|
|
|
@ -6,8 +6,8 @@ function test(cond, message) {
|
||||||
if(!cond) throw new Error(message);
|
if(!cond) throw new Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// load tests from libary1, with script loader
|
// load tests from library1, with script loader
|
||||||
require("script!../js/libary1.js");
|
require("script!../js/library1.js");
|
||||||
|
|
||||||
// Buildin 'style' loader adds css to document
|
// Buildin 'style' loader adds css to document
|
||||||
require("../css/stylesheet.css");
|
require("../css/stylesheet.css");
|
||||||
|
@ -25,15 +25,15 @@ function testCase(number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("main", function() {
|
describe("main", function() {
|
||||||
it("should load libary1 with script-loader", function() {
|
it("should load library1 with script-loader", function() {
|
||||||
should.exist(window.libary1);
|
should.exist(window.library1);
|
||||||
window.libary1.should.be.eql(true);
|
window.library1.should.be.eql(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should load libary1 with script-loader", function() {
|
it("should load library1 with script-loader", function() {
|
||||||
should.exist(window.libary2);
|
should.exist(window.library2);
|
||||||
should.exist(window.libary2.ok);
|
should.exist(window.library2.ok);
|
||||||
window.libary2.ok.should.be.eql(true);
|
window.library2.ok.should.be.eql(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("resolving", function() {
|
describe("resolving", function() {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
// Single File Libary
|
// Single File library
|
||||||
var loadTimeLibary1 = typeof window.libary1 === "undefined"
|
var loadTimelibrary1 = typeof window.library1 === "undefined"
|
||||||
describe("Libary1", function() {
|
describe("library1", function() {
|
||||||
it("should load libary1 only once", function() {
|
it("should load library1 only once", function() {
|
||||||
loadTimeLibary1.should.be.ok;
|
loadTimelibrary1.should.be.ok;
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should load a component", function() {
|
it("should load a component", function() {
|
|
@ -1,5 +1,5 @@
|
||||||
// Chunked File Libary
|
// Chunked File library
|
||||||
describe("libary2", function() {
|
describe("library2", function() {
|
||||||
var tickExtra, tickEmpty, tickMerged;
|
var tickExtra, tickEmpty, tickMerged;
|
||||||
var extraValue, testValue;
|
var extraValue, testValue;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
var should = chai.should();
|
var should = chai.should();
|
||||||
mocha.setup('bdd');
|
mocha.setup('bdd');
|
||||||
</script>
|
</script>
|
||||||
<script src="js/libary2.js" charset="utf-8"></script>
|
<script src="js/library2.js" charset="utf-8"></script>
|
||||||
<script src="js/web.js" charset="utf-8"></script>
|
<script src="js/web.js" charset="utf-8"></script>
|
||||||
<!-- fixtures -->
|
<!-- fixtures -->
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in New Issue