-
Notifications
You must be signed in to change notification settings - Fork 23
Support for Webpack 2 ? #39
Comments
throw a exception in webpack 2.2.1 TypeError: Cannot read property 'plugin' of null |
I've create a "monster" on my branch and I'm not proud of it, but it somehow "works" with webpack2 - I'm able to compile quite big project with it. It is nowhere near to a pull request. I'm not able to work on it right now so I'm going to shortly describe what I've discovered during my dark magic operation and maybe this will help someone else to create the real solution. I've to also admit that my knowledge of webpack internals is really limited so many of my conclusions can be just wrong. Here it goes (to simplify I'm using standard paths and filenames in this description):
So here is my limited understanding of this plugin workflow after two hours of hacking on it and here are my modifications - many changes are hacks which are related to the test suite configuration. My branch misses multiple options (it doesn't read global |
There is no need for a plugin anymore with webpack 2 -- webpack/webpack#2324 (comment) {
modules: [path.resolve(__dirname, "app"), "node_modules"]
// (was split into `root`, `modulesDirectories` and `fallback` in the old options)
// In which folders the resolver look for modules
// relative paths are looked up in every parent folder (like node_modules)
// absolute paths are looked up directly
// the order is respected
descriptionFiles: ["package.json", "bower.json"],
// These JSON files are read in directories
mainFields: ["main", "browser"],
// These fields in the description files are looked up when trying to resolve the package directory
mainFiles: ["index"]
// These files are tried when trying to resolve a directory
aliasFields: ["browser"],
// These fields in the description files offer aliasing in this package
// The content of these fields is an object where requests to a key are mapped to the corresponding value
extensions: [".js", ".json"],
// These extensions are tried when resolving a file
enforceExtension: false,
// If false it will also try to use no extension from above
moduleExtensions: ["-loader"],
// These extensions are tried when resolving a module
enforceModuleExtension: false,
// If false it's also try to use no module extension from above
alias: {
jquery: path.resolve(__dirname, "vendor/jquery-2.0.0.js")
}
// These aliasing is used when trying to resolve a module
} |
Does it support multiple |
No description provided.
The text was updated successfully, but these errors were encountered: