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/browsertest/js
|
||||
/examples/*/js
|
||||
.DS_Store
|
|
@ -326,7 +326,7 @@ Options:
|
|||
--filenames Output Filenames Into File [boolean] [default: false]
|
||||
--options Options JSON File [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]
|
||||
--single Disable lazy loading [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
|
||||
// deprecated name: scriptSrcPrefix
|
||||
|
||||
libary: "mylib", // default: null
|
||||
library: "mylib", // default: null
|
||||
// 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
|
||||
// include the filename of each module as comment before the module
|
||||
|
|
|
@ -33,8 +33,8 @@ var argv = require("optimist")
|
|||
.string("public-prefix")
|
||||
.describe("public-prefix", "Path Prefix For JavaScript Loading")
|
||||
|
||||
.string("libary")
|
||||
.describe("libary", "Stores the exports into this variable")
|
||||
.string("library")
|
||||
.describe("library", "Stores the exports into this variable")
|
||||
|
||||
.boolean("colors")
|
||||
.describe("colors", "Output Stats with colors")
|
||||
|
@ -145,8 +145,8 @@ if(argv.filenames) {
|
|||
options.includeFilenames = true;
|
||||
}
|
||||
|
||||
if(argv.libary) {
|
||||
options.libary = argv.libary;
|
||||
if(argv.library) {
|
||||
options.library = argv.library;
|
||||
}
|
||||
|
||||
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.outputJsonpFunction)
|
||||
options.outputJsonpFunction = "webpackJsonp" + (options.libary || "");
|
||||
options.outputJsonpFunction = "webpackJsonp" + (options.library || "");
|
||||
options.publicPrefix = options.publicPrefix || "";
|
||||
|
||||
options.context = options.context || context;
|
||||
|
@ -282,7 +282,7 @@ function webpack(context, moduleName, options, callback) {
|
|||
var hash;
|
||||
try {
|
||||
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.outputJsonpFunction));
|
||||
hash.update(JSON.stringify(options.publicPrefix));
|
||||
|
@ -320,10 +320,10 @@ function webpack(context, moduleName, options, callback) {
|
|||
else
|
||||
hash = "";
|
||||
|
||||
// if it should be a libary, we prepend a variable name
|
||||
if(options.libary) {
|
||||
// if it should be a library, we prepend a variable name
|
||||
if(options.library) {
|
||||
buffer.push("/******/var ");
|
||||
buffer.push(options.libary);
|
||||
buffer.push(options.library);
|
||||
buffer.push("=\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ console.log("compile scripts...");
|
|||
var extraArgsNoWatch = extraArgs.slice(0);
|
||||
var watchIndex = extraArgsNoWatch.indexOf("--watch");
|
||||
if(watchIndex != -1) extraArgsNoWatch.splice(watchIndex, 1);
|
||||
// node ../../bin/webpack --colors --single --libary libary1 node_modules/libary1 js/libary1.js
|
||||
var libary1 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--single", "--libary", "libary1",
|
||||
"node_modules/libary1", "js/libary1.js"], extraArgsNoWatch));
|
||||
bindOutput(libary1);
|
||||
libary1.on("exit", function(code) {
|
||||
// node ../../bin/webpack --colors --single --library library1 node_modules/library1 js/library1.js
|
||||
var library1 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--single", "--library", "library1",
|
||||
"node_modules/library1", "js/library1.js"], extraArgsNoWatch));
|
||||
bindOutput(library1);
|
||||
library1.on("exit", function(code) {
|
||||
if(code === 0) {
|
||||
// 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",
|
||||
|
@ -40,6 +40,6 @@ libary1.on("exit", function(code) {
|
|||
bindOutput(main);
|
||||
}
|
||||
});
|
||||
var libary2 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--libary", "libary2",
|
||||
"--public-prefix", "js/", "--options", "libary2config.js", "node_modules/libary2", "js/libary2.js"], extraArgsNoWatch));
|
||||
bindOutput(libary2);
|
||||
var library2 = cp.spawn("node", join(["../../bin/webpack.js", "--colors", "--library", "library2",
|
||||
"--public-prefix", "js/", "--options", "library2config.js", "node_modules/library2", "js/library2.js"], extraArgsNoWatch));
|
||||
bindOutput(library2);
|
||||
|
|
|
@ -6,8 +6,8 @@ function test(cond, message) {
|
|||
if(!cond) throw new Error(message);
|
||||
}
|
||||
|
||||
// load tests from libary1, with script loader
|
||||
require("script!../js/libary1.js");
|
||||
// load tests from library1, with script loader
|
||||
require("script!../js/library1.js");
|
||||
|
||||
// Buildin 'style' loader adds css to document
|
||||
require("../css/stylesheet.css");
|
||||
|
@ -25,15 +25,15 @@ function testCase(number) {
|
|||
}
|
||||
|
||||
describe("main", function() {
|
||||
it("should load libary1 with script-loader", function() {
|
||||
should.exist(window.libary1);
|
||||
window.libary1.should.be.eql(true);
|
||||
it("should load library1 with script-loader", function() {
|
||||
should.exist(window.library1);
|
||||
window.library1.should.be.eql(true);
|
||||
});
|
||||
|
||||
it("should load libary1 with script-loader", function() {
|
||||
should.exist(window.libary2);
|
||||
should.exist(window.libary2.ok);
|
||||
window.libary2.ok.should.be.eql(true);
|
||||
it("should load library1 with script-loader", function() {
|
||||
should.exist(window.library2);
|
||||
should.exist(window.library2.ok);
|
||||
window.library2.ok.should.be.eql(true);
|
||||
});
|
||||
|
||||
describe("resolving", function() {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Single File Libary
|
||||
var loadTimeLibary1 = typeof window.libary1 === "undefined"
|
||||
describe("Libary1", function() {
|
||||
it("should load libary1 only once", function() {
|
||||
loadTimeLibary1.should.be.ok;
|
||||
// Single File library
|
||||
var loadTimelibrary1 = typeof window.library1 === "undefined"
|
||||
describe("library1", function() {
|
||||
it("should load library1 only once", function() {
|
||||
loadTimelibrary1.should.be.ok;
|
||||
});
|
||||
|
||||
it("should load a component", function() {
|
|
@ -1,5 +1,5 @@
|
|||
// Chunked File Libary
|
||||
describe("libary2", function() {
|
||||
// Chunked File library
|
||||
describe("library2", function() {
|
||||
var tickExtra, tickEmpty, tickMerged;
|
||||
var extraValue, testValue;
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
var should = chai.should();
|
||||
mocha.setup('bdd');
|
||||
</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>
|
||||
<!-- fixtures -->
|
||||
<style>
|
||||
|
|
Loading…
Reference in New Issue