Skip to content

Commit 6a2f255

Browse files
committed
fixed parsing of packageMains options
1 parent 1a83625 commit 6a2f255

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎lib/WebpackOptionsApply.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
236236
makeRootPlugin("module", options.resolve.fallback),
237237
new ModuleAsFilePlugin("module"),
238238
new ModuleAsDirectoryPlugin("module"),
239-
new DirectoryDescriptionFilePlugin("package.json", ["webpack", "browserify", "web", ["jam", "main"], "main"]),
239+
new DirectoryDescriptionFilePlugin("package.json", options.resolve.packageMains),
240240
new DirectoryDefaultFilePlugin(["index"]),
241241
new FileAppendPlugin(options.resolve.extensions)
242242
);
@@ -259,7 +259,7 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
259259
new ModuleTemplatesPlugin("loader-module", options.resolveLoader.moduleTemplates, "module"),
260260
new ModuleAsFilePlugin("module"),
261261
new ModuleAsDirectoryPlugin("module"),
262-
new DirectoryDescriptionFilePlugin("package.json", ["webpackLoader", "webLoader", "loader", "main"]),
262+
new DirectoryDescriptionFilePlugin("package.json", options.resolveLoader.packageMains),
263263
new DirectoryDefaultFilePlugin(["index"]),
264264
new FileAppendPlugin(options.resolveLoader.extensions)
265265
);

‎lib/WebpackOptionsDefaulter.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function WebpackOptionsDefaulter() {
4545
this.set("resolve.extensions", ["", ".webpack.js", ".web.js", ".js"]);
4646
this.set("resolveLoader.extensions", ["", ".webpack-loader.js", ".web-loader.js", ".loader.js", ".js"]);
4747

48-
this.set("resolve.packageMains", ["webpack", "browser", "web", "main"]);
48+
this.set("resolve.packageMains", ["webpack", "browser", "web", "browserify", ["jam", "main"], "main"]);
4949
this.set("resolveLoader.packageMains", ["webpackLoader", "webLoader", "loader", "main"]);
5050

5151
this.set("optimize.occurenceOrderPreferEntry", true);

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack",
3-
"version": "0.11.0-beta21",
3+
"version": "0.11.0-beta22",
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD/Labeled 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, jade, coffee, css, less, ... and your custom stuff.",
66
"dependencies": {

0 commit comments

Comments
 (0)