Browse Source

Renamed *libary* to *library*

Conflicts:
	test/browsertest/build.js
pull/36/head
Rainer Dreyer 10 years ago committed by Tobias Koppers
parent
commit
0366444379
  1. 1
      .gitignore
  2. 6
      README.md
  3. 8
      bin/webpack.js
  4. 10
      lib/webpack.js
  5. 16
      test/browsertest/build.js
  6. 18
      test/browsertest/lib/index.web.js
  7. 0
      test/browsertest/library2config.js
  8. 10
      test/browsertest/node_modules/library1/index.js
  9. 0
      test/browsertest/node_modules/library1/lib/comp.js
  10. 0
      test/browsertest/node_modules/library1/lib/component.js
  11. 0
      test/browsertest/node_modules/library1/node_modules/submodule1/index.js
  12. 0
      test/browsertest/node_modules/library1/node_modules/submodule2/index.js
  13. 0
      test/browsertest/node_modules/library2/lib/extra.js
  14. 0
      test/browsertest/node_modules/library2/lib/extra2.js
  15. 4
      test/browsertest/node_modules/library2/lib/main.js
  16. 0
      test/browsertest/node_modules/library2/lib/test.js
  17. 0
      test/browsertest/node_modules/library2/node_modules/submodule1/index.js
  18. 0
      test/browsertest/node_modules/library2/node_modules/submodule2/index.js
  19. 0
      test/browsertest/node_modules/library2/node_modules/submodule3/index.js
  20. 0
      test/browsertest/node_modules/library2/package.json
  21. 2
      test/browsertest/tests.html

1
.gitignore vendored

@ -2,3 +2,4 @@
/test/js
/test/browsertest/js
/examples/*/js
.DS_Store

6
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

8
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) {

10
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");
}

16
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);

18
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() {

0
test/browsertest/libary2config.js → test/browsertest/library2config.js

10
test/browsertest/node_modules/libary1/index.js → test/browsertest/node_modules/library1/index.js generated vendored

@ -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() {

0
test/browsertest/node_modules/libary1/lib/comp.js → test/browsertest/node_modules/library1/lib/comp.js generated vendored

0
test/browsertest/node_modules/libary1/lib/component.js → test/browsertest/node_modules/library1/lib/component.js generated vendored

0
test/browsertest/node_modules/libary1/node_modules/submodule1/index.js → test/browsertest/node_modules/library1/node_modules/submodule1/index.js generated vendored

0
test/browsertest/node_modules/libary1/node_modules/submodule2/index.js → test/browsertest/node_modules/library1/node_modules/submodule2/index.js generated vendored

0
test/browsertest/node_modules/libary2/lib/extra.js → test/browsertest/node_modules/library2/lib/extra.js generated vendored

0
test/browsertest/node_modules/libary2/lib/extra2.js → test/browsertest/node_modules/library2/lib/extra2.js generated vendored

4
test/browsertest/node_modules/libary2/lib/main.js → test/browsertest/node_modules/library2/lib/main.js generated vendored

@ -1,5 +1,5 @@
// Chunked File Libary
describe("libary2", function() {
// Chunked File library
describe("library2", function() {
var tickExtra, tickEmpty, tickMerged;
var extraValue, testValue;

0
test/browsertest/node_modules/libary2/lib/test.js → test/browsertest/node_modules/library2/lib/test.js generated vendored

0
test/browsertest/node_modules/libary2/node_modules/submodule1/index.js → test/browsertest/node_modules/library2/node_modules/submodule1/index.js generated vendored

0
test/browsertest/node_modules/libary2/node_modules/submodule2/index.js → test/browsertest/node_modules/library2/node_modules/submodule2/index.js generated vendored

0
test/browsertest/node_modules/libary2/node_modules/submodule3/index.js → test/browsertest/node_modules/library2/node_modules/submodule3/index.js generated vendored

0
test/browsertest/node_modules/libary2/package.json → test/browsertest/node_modules/library2/package.json generated vendored

2
test/browsertest/tests.html

@ -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…
Cancel
Save