webpack 2.2.0-rc.6 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +39 -63
  2. package/bin/webpack.js +3 -3
  3. package/buildin/harmony-module.js +0 -6
  4. package/buildin/module.js +0 -2
  5. package/lib/APIPlugin.js +2 -8
  6. package/lib/AsyncDependenciesBlock.js +46 -55
  7. package/lib/ChunkTemplate.js +25 -26
  8. package/lib/CompatibilityPlugin.js +49 -46
  9. package/lib/Compilation.js +279 -138
  10. package/lib/Compiler.js +5 -2
  11. package/lib/ConstPlugin.js +2 -6
  12. package/lib/DefinePlugin.js +9 -27
  13. package/lib/EnvironmentPlugin.js +25 -9
  14. package/lib/EvalDevToolModulePlugin.js +15 -10
  15. package/lib/EvalSourceMapDevToolModuleTemplatePlugin.js +1 -1
  16. package/lib/EvalSourceMapDevToolPlugin.js +24 -18
  17. package/lib/ExtendedAPIPlugin.js +1 -6
  18. package/lib/FlagDependencyExportsPlugin.js +72 -79
  19. package/lib/FlagInitialModulesAsUsedPlugin.js +17 -13
  20. package/lib/FunctionModulePlugin.js +17 -11
  21. package/lib/HotModuleReplacementPlugin.js +3 -13
  22. package/lib/HotUpdateChunkTemplate.js +21 -22
  23. package/lib/JsonpTemplatePlugin.js +15 -11
  24. package/lib/LibManifestPlugin.js +1 -1
  25. package/lib/LoaderTargetPlugin.js +14 -10
  26. package/lib/MainTemplate.js +193 -191
  27. package/lib/MultiWatching.js +16 -14
  28. package/lib/NoEmitOnErrorsPlugin.js +14 -11
  29. package/lib/NodeStuffPlugin.js +6 -30
  30. package/lib/NormalModuleFactory.js +2 -2
  31. package/lib/NormalModuleReplacementPlugin.js +36 -31
  32. package/lib/Parser.js +11 -8
  33. package/lib/ParserHelpers.js +19 -5
  34. package/lib/ProvidePlugin.js +2 -6
  35. package/lib/RequestShortener.js +49 -47
  36. package/lib/RequireJsStuffPlugin.js +5 -20
  37. package/lib/RuleSet.js +28 -20
  38. package/lib/SourceMapDevToolPlugin.js +1 -1
  39. package/lib/Template.js +133 -132
  40. package/lib/compareLocations.js +9 -8
  41. package/lib/dependencies/AMDPlugin.js +111 -115
  42. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +157 -154
  43. package/lib/dependencies/CommonJsPlugin.js +81 -85
  44. package/lib/dependencies/CommonJsRequireDependencyParserPlugin.js +73 -75
  45. package/lib/dependencies/ContextDependencyTemplateAsId.js +21 -18
  46. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +23 -29
  47. package/lib/dependencies/CriticalDependencyWarning.js +13 -8
  48. package/lib/dependencies/{HarmonyCompatiblilityDependency.js → HarmonyCompatibilityDependency.js} +3 -3
  49. package/lib/dependencies/HarmonyDetectionParserPlugin.js +2 -2
  50. package/lib/dependencies/HarmonyModulesPlugin.js +51 -49
  51. package/lib/dependencies/ImportParserPlugin.js +31 -28
  52. package/lib/dependencies/ImportPlugin.js +28 -24
  53. package/lib/dependencies/LocalModule.js +17 -13
  54. package/lib/dependencies/ModuleDependencyTemplateAsId.js +15 -17
  55. package/lib/dependencies/ModuleDependencyTemplateAsRequireId.js +15 -17
  56. package/lib/dependencies/RequireContextPlugin.js +59 -57
  57. package/lib/dependencies/RequireEnsurePlugin.js +22 -26
  58. package/lib/dependencies/RequireIncludePlugin.js +18 -23
  59. package/lib/dependencies/RequireResolveDependencyParserPlugin.js +59 -56
  60. package/lib/dependencies/SystemPlugin.js +34 -36
  61. package/lib/dependencies/WebpackMissingModule.js +10 -18
  62. package/lib/node/NodeTargetPlugin.js +8 -5
  63. package/lib/node/NodeWatchFileSystem.js +54 -53
  64. package/lib/optimize/CommonsChunkPlugin.js +163 -166
  65. package/lib/optimize/RemoveParentModulesPlugin.js +36 -27
  66. package/lib/validateSchema.js +18 -18
  67. package/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js +22 -20
  68. package/package.json +13 -7
@@ -2,25 +2,27 @@
2
2
  MIT License http://www.opensource.org/licenses/mit-license.php
3
3
  Author Tobias Koppers @sokra
4
4
  */
5
- var ConcatSource = require("webpack-sources").ConcatSource;
6
- var Template = require("../Template");
5
+ "use strict";
6
+ const ConcatSource = require("webpack-sources").ConcatSource;
7
+ const Template = require("../Template");
7
8
 
8
- function WebWorkerHotUpdateChunkTemplatePlugin() {}
9
- module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
9
+ class WebWorkerHotUpdateChunkTemplatePlugin {
10
10
 
11
- WebWorkerHotUpdateChunkTemplatePlugin.prototype.apply = function(hotUpdateChunkTemplate) {
12
- hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
13
- var chunkCallbackName = this.outputOptions.hotUpdateFunction || Template.toIdentifier("webpackHotUpdate" + (this.outputOptions.library || ""));
14
- var source = new ConcatSource();
15
- source.add(chunkCallbackName + "(" + JSON.stringify(id) + ",");
16
- source.add(modulesSource);
17
- source.add(")");
18
- return source;
19
- });
20
- hotUpdateChunkTemplate.plugin("hash", function(hash) {
21
- hash.update("WebWorkerHotUpdateChunkTemplatePlugin");
22
- hash.update("3");
23
- hash.update(this.outputOptions.hotUpdateFunction + "");
24
- hash.update(this.outputOptions.library + "");
25
- });
26
- };
11
+ apply(hotUpdateChunkTemplate) {
12
+ hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
13
+ const chunkCallbackName = this.outputOptions.hotUpdateFunction || Template.toIdentifier("webpackHotUpdate" + (this.outputOptions.library || ""));
14
+ const source = new ConcatSource();
15
+ source.add(chunkCallbackName + "(" + JSON.stringify(id) + ",");
16
+ source.add(modulesSource);
17
+ source.add(")");
18
+ return source;
19
+ });
20
+ hotUpdateChunkTemplate.plugin("hash", function(hash) {
21
+ hash.update("WebWorkerHotUpdateChunkTemplatePlugin");
22
+ hash.update("3");
23
+ hash.update(this.outputOptions.hotUpdateFunction + "");
24
+ hash.update(this.outputOptions.library + "");
25
+ });
26
+ }
27
+ }
28
+ module.exports = WebWorkerHotUpdateChunkTemplatePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "2.2.0-rc.6",
3
+ "version": "2.2.1",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "dependencies": {
@@ -12,7 +12,7 @@
12
12
  "enhanced-resolve": "^3.0.0",
13
13
  "interpret": "^1.0.0",
14
14
  "json-loader": "^0.5.4",
15
- "loader-runner": "^2.2.0",
15
+ "loader-runner": "^2.3.0",
16
16
  "loader-utils": "^0.2.16",
17
17
  "memory-fs": "~0.4.1",
18
18
  "mkdirp": "~0.5.0",
@@ -48,6 +48,7 @@
48
48
  "js-beautify": "^1.5.10",
49
49
  "less": "^2.5.1",
50
50
  "less-loader": "^2.0.0",
51
+ "lodash": "^4.17.4",
51
52
  "mocha": "^3.2.0",
52
53
  "mocha-lcov-reporter": "^1.0.0",
53
54
  "nsp": "^2.6.1",
@@ -56,6 +57,7 @@
56
57
  "react-dom": "^15.2.1",
57
58
  "script-loader": "~0.7.0",
58
59
  "should": "^11.1.1",
60
+ "simple-git": "^1.65.0",
59
61
  "sinon": "^1.17.7",
60
62
  "style-loader": "~0.13.0",
61
63
  "url-loader": "~0.5.0",
@@ -65,7 +67,7 @@
65
67
  "worker-loader": "~0.7.0"
66
68
  },
67
69
  "engines": {
68
- "node": ">=4.7.0 <5.0.0 || >=5.10"
70
+ "node": ">=4.3.0 <5.0.0 || >=5.10"
69
71
  },
70
72
  "repository": {
71
73
  "type": "git",
@@ -84,17 +86,21 @@
84
86
  "schemas/"
85
87
  ],
86
88
  "scripts": {
87
- "test": "mocha --harmony --check-leaks",
88
- "travis:test": "npm run cover -- --report lcovonly",
89
+ "test": "mocha test/*.test.js --harmony --check-leaks",
90
+ "travis:test": "npm run cover:min",
89
91
  "travis:lint": "npm run lint-files && npm run nsp",
90
- "appveyor": "node --max_old_space_size=4096 node_modules\\mocha\\bin\\mocha --harmony",
92
+ "travis:benchmark": "npm run benchmark",
93
+ "appveyor:test": "node --max_old_space_size=4096 node_modules\\mocha\\bin\\mocha --harmony test/*.test.js",
94
+ "appveyor:benchmark": "npm run benchmark",
91
95
  "build:examples": "cd examples && node buildAll.js",
92
96
  "pretest": "npm run lint-files",
93
97
  "lint-files": "npm run lint && npm run beautify-lint",
94
98
  "lint": "eslint lib bin hot buildin test/**/webpack.config.js test/binCases/**/test.js examples/**/webpack.config.js",
95
99
  "beautify-lint": "beautify-lint 'lib/**/*.js' 'hot/**/*.js' 'bin/**/*.js' 'benchmark/*.js' 'test/*.js'",
96
100
  "nsp": "nsp check --output summary",
97
- "cover": "node --harmony ./node_modules/.bin/istanbul cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha",
101
+ "benchmark": "mocha test/*.benchmark.js --harmony -R spec",
102
+ "cover": "node --harmony ./node_modules/istanbul/lib/cli.js cover -x '**/*.runtime.js' node_modules/mocha/bin/_mocha -- test/*.test.js",
103
+ "cover:min": "node --harmony ./node_modules/.bin/istanbul cover -x '**/*.runtime.js' --report lcovonly node_modules/mocha/bin/_mocha -- test/*.test.js",
98
104
  "publish-patch": "npm run lint && npm run beautify-lint && mocha && npm version patch && git push && git push --tags && npm publish"
99
105
  }
100
106
  }