Skip to content

Commit

Permalink
Renamed *libary* to *library*
Browse files Browse the repository at this point in the history
Conflicts:
	test/browsertest/build.js
  • Loading branch information
rdrey authored and sokra committed Nov 5, 2012
1 parent cbf909e commit 0366444
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/test/js
/test/browsertest/js
/examples/*/js
.DS_Store
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions bin/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions lib/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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");
}

Expand Down
16 changes: 8 additions & 8 deletions test/browsertest/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ 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",
"--public-prefix", "js/", "lib/index", "js/web.js"], extraArgs));
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);
18 changes: 9 additions & 9 deletions test/browsertest/lib/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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() {
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/browsertest/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 0366444

Please sign in to comment.