diff --git a/.gitignore b/.gitignore index 120b943c5..7c550a925 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /test/js /test/browsertest/js /examples/*/js +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index 598d8932f..326348718 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/webpack.js b/bin/webpack.js index ecdfb17ed..b33868a8d 100644 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -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) { diff --git a/lib/webpack.js b/lib/webpack.js index f9437a2c2..d010417b5 100644 --- a/lib/webpack.js +++ b/lib/webpack.js @@ -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"); } diff --git a/test/browsertest/build.js b/test/browsertest/build.js index d1512ed33..4560aece3 100644 --- a/test/browsertest/build.js +++ b/test/browsertest/build.js @@ -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); diff --git a/test/browsertest/lib/index.web.js b/test/browsertest/lib/index.web.js index 865a0aff1..f3540a92c 100644 --- a/test/browsertest/lib/index.web.js +++ b/test/browsertest/lib/index.web.js @@ -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() { diff --git a/test/browsertest/libary2config.js b/test/browsertest/library2config.js similarity index 100% rename from test/browsertest/libary2config.js rename to test/browsertest/library2config.js diff --git a/test/browsertest/node_modules/libary1/index.js b/test/browsertest/node_modules/library1/index.js similarity index 73% rename from test/browsertest/node_modules/libary1/index.js rename to test/browsertest/node_modules/library1/index.js index 735409159..ab0bcf7eb 100644 --- a/test/browsertest/node_modules/libary1/index.js +++ b/test/browsertest/node_modules/library1/index.js @@ -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() { diff --git a/test/browsertest/node_modules/libary1/lib/comp.js b/test/browsertest/node_modules/library1/lib/comp.js similarity index 100% rename from test/browsertest/node_modules/libary1/lib/comp.js rename to test/browsertest/node_modules/library1/lib/comp.js diff --git a/test/browsertest/node_modules/libary1/lib/component.js b/test/browsertest/node_modules/library1/lib/component.js similarity index 100% rename from test/browsertest/node_modules/libary1/lib/component.js rename to test/browsertest/node_modules/library1/lib/component.js diff --git a/test/browsertest/node_modules/libary1/node_modules/submodule1/index.js b/test/browsertest/node_modules/library1/node_modules/submodule1/index.js similarity index 100% rename from test/browsertest/node_modules/libary1/node_modules/submodule1/index.js rename to test/browsertest/node_modules/library1/node_modules/submodule1/index.js diff --git a/test/browsertest/node_modules/libary1/node_modules/submodule2/index.js b/test/browsertest/node_modules/library1/node_modules/submodule2/index.js similarity index 100% rename from test/browsertest/node_modules/libary1/node_modules/submodule2/index.js rename to test/browsertest/node_modules/library1/node_modules/submodule2/index.js diff --git a/test/browsertest/node_modules/libary2/lib/extra.js b/test/browsertest/node_modules/library2/lib/extra.js similarity index 100% rename from test/browsertest/node_modules/libary2/lib/extra.js rename to test/browsertest/node_modules/library2/lib/extra.js diff --git a/test/browsertest/node_modules/libary2/lib/extra2.js b/test/browsertest/node_modules/library2/lib/extra2.js similarity index 100% rename from test/browsertest/node_modules/libary2/lib/extra2.js rename to test/browsertest/node_modules/library2/lib/extra2.js diff --git a/test/browsertest/node_modules/libary2/lib/main.js b/test/browsertest/node_modules/library2/lib/main.js similarity index 96% rename from test/browsertest/node_modules/libary2/lib/main.js rename to test/browsertest/node_modules/library2/lib/main.js index 838e8d64c..cda3f8913 100644 --- a/test/browsertest/node_modules/libary2/lib/main.js +++ b/test/browsertest/node_modules/library2/lib/main.js @@ -1,5 +1,5 @@ -// Chunked File Libary -describe("libary2", function() { +// Chunked File library +describe("library2", function() { var tickExtra, tickEmpty, tickMerged; var extraValue, testValue; diff --git a/test/browsertest/node_modules/libary2/lib/test.js b/test/browsertest/node_modules/library2/lib/test.js similarity index 100% rename from test/browsertest/node_modules/libary2/lib/test.js rename to test/browsertest/node_modules/library2/lib/test.js diff --git a/test/browsertest/node_modules/libary2/node_modules/submodule1/index.js b/test/browsertest/node_modules/library2/node_modules/submodule1/index.js similarity index 100% rename from test/browsertest/node_modules/libary2/node_modules/submodule1/index.js rename to test/browsertest/node_modules/library2/node_modules/submodule1/index.js diff --git a/test/browsertest/node_modules/libary2/node_modules/submodule2/index.js b/test/browsertest/node_modules/library2/node_modules/submodule2/index.js similarity index 100% rename from test/browsertest/node_modules/libary2/node_modules/submodule2/index.js rename to test/browsertest/node_modules/library2/node_modules/submodule2/index.js diff --git a/test/browsertest/node_modules/libary2/node_modules/submodule3/index.js b/test/browsertest/node_modules/library2/node_modules/submodule3/index.js similarity index 100% rename from test/browsertest/node_modules/libary2/node_modules/submodule3/index.js rename to test/browsertest/node_modules/library2/node_modules/submodule3/index.js diff --git a/test/browsertest/node_modules/libary2/package.json b/test/browsertest/node_modules/library2/package.json similarity index 100% rename from test/browsertest/node_modules/libary2/package.json rename to test/browsertest/node_modules/library2/package.json diff --git a/test/browsertest/tests.html b/test/browsertest/tests.html index 9055d5f5e..5386d6191 100644 --- a/test/browsertest/tests.html +++ b/test/browsertest/tests.html @@ -12,7 +12,7 @@ var should = chai.should(); mocha.setup('bdd'); - +