Skip to content

Commit 68ee0a6

Browse files
committed
some bugfixes and fallback option
1 parent 7aa63f1 commit 68ee0a6

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎lib/Compiler.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Compiler.prototype.newCompilation = function(params) {
241241
};
242242

243243
Compiler.prototype.createNormalModuleFactory = function() {
244-
var normalModuleFactory = new NormalModuleFactory(this.resolvers, this.parser, this.options.module || {});
244+
var normalModuleFactory = new NormalModuleFactory(this.options.context, this.resolvers, this.parser, this.options.module || {});
245245
this.applyPlugins("normal-module-factory", normalModuleFactory);
246246
return normalModuleFactory;
247247
};

‎lib/NormalModuleFactory.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ var Tapable = require("tapable");
88
var NormalModule = require("./NormalModule");
99
var LoadersList = require("webpack-core/lib/LoadersList");
1010

11-
function NormalModuleFactory(resolvers, parser, options) {
11+
function NormalModuleFactory(context, resolvers, parser, options) {
1212
Tapable.call(this);
1313
this.resolvers = resolvers;
1414
this.parser = parser;
1515
this.loaders = new LoadersList(options.loaders);
1616
this.preLoaders = new LoadersList(options.preLoaders);
1717
this.postLoaders = new LoadersList(options.postLoaders);
18-
this.context = options.context || "";
18+
this.context = context || "";
1919
}
2020
module.exports = NormalModuleFactory;
2121

‎lib/WebpackOptionsApply.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
105105
compiler.applyPlugins("after-plugins", compiler);
106106
compiler.resolvers.normal.apply(
107107
new ModuleAliasPlugin(options.resolve.alias),
108-
new ModulesInDirectoriesPlugin("module", options.resolve.modulesDirectories),
109108
makeRootPlugin(options.resolve.root),
109+
new ModulesInDirectoriesPlugin("module", options.resolve.modulesDirectories),
110+
makeRootPlugin(options.resolve.fallback),
110111
new ModuleAsFilePlugin("module"),
111112
new ModuleAsDirectoryPlugin("module"),
112113
new DirectoryDescriptionFilePlugin("package.json", ["webpack", "browserify", "web", ["jam", "main"], "main"]),
@@ -115,16 +116,18 @@ WebpackOptionsApply.prototype.process = function(options, compiler) {
115116
);
116117
compiler.resolvers.context.apply(
117118
new ModuleAliasPlugin(options.resolve.alias),
118-
new ModulesInDirectoriesPlugin("module", options.resolve.modulesDirectories),
119119
makeRootPlugin(options.resolve.root),
120+
new ModulesInDirectoriesPlugin("module", options.resolve.modulesDirectories),
121+
makeRootPlugin(options.resolve.fallback),
120122
new ModuleAsFilePlugin("module"),
121123
new ModuleAsDirectoryPlugin("module"),
122124
new DirectoryResultPlugin()
123125
);
124126
compiler.resolvers.loader.apply(
125127
new ModuleAliasPlugin(options.resolveLoader.alias),
126-
new ModulesInDirectoriesPlugin("loader-module", options.resolveLoader.modulesDirectories),
127128
makeRootPlugin(options.resolveLoader.root),
129+
new ModulesInDirectoriesPlugin("loader-module", options.resolveLoader.modulesDirectories),
130+
makeRootPlugin(options.resolveLoader.fallback),
128131
new ModuleTemplatesPlugin("loader-module", options.resolveLoader.moduleTemplates, "module"),
129132
new ModuleAsFilePlugin("module"),
130133
new ModuleAsDirectoryPlugin("module"),

‎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.9.0-beta6",
3+
"version": "0.9.0-beta7",
44
"author": "Tobias Koppers @sokra",
55
"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, jade, coffee, css, less, ... and your custom stuff.",
66
"dependencies": {

0 commit comments

Comments
 (0)