ericclemmons / terse-webpack

Simplified, fluent Webpack API with presets. Describe *what* your app needs, not *how*.
MIT License
215 stars 15 forks source link

I've root-caused three problems getting the example to work, but I don't know how to fix #34

Open eldrgeek opened 7 years ago

eldrgeek commented 7 years ago
  1. Webpack schema no longer allows preLoaders so errors out. The member is populated with an empty array, so it can be deleted. I worked around this one by adding

delete module.exports.module.preLoaders

to `webpack.config.server.js' but it should be fixed elsewhere. Where?

  1. .plugin("webpack.ProvidePlugin", { React: "react" }) in webpack.config.defaults.js gives a non-fatal error at line 306 in tapable.js

arguments[i].apply(this);

In the debugger, if I execute the line twice, it does not give an error the second time.

Debugger listening on [::]:40736
webpack: Using compiler.parser is deprecated.
Use compiler.plugin("compilation", function(compilation, data) {
  data.normalModuleFactory.plugin("parser", function(parser, options) { parser.plugin(/* ... */); });
}); instead. It was called at ProvidePlugin.<anonymous> (/home/mwolf/tools/terse-webpack/example/node_modules/@terse/webpack/node_modules/webpack/lib/ProvidePlugin.js:30:19).
  1. At the same location, when trying to bind Plugin {name: "npm-install-webpack-plugin", args: Array[0]} It throws a fatal error:

TypeError: Cannot read property 'plugin' of null

The error comes from plugins.js , function NpmInstallPlugin.prototype.apply

The statements

compiler.resolvers.loader.plugin("module", this.resolveLoader.bind(this));

  // Install project dependencies on demand
  compiler.resolvers.normal.plugin("module", this.resolveModule.bind(this));

Both fail because the resolvers member for this plugin is:

Object {normal: null, loader: null, context: null}

I'm willing to prepare a PR if you advise me how and where to fix. I think it's a great idea, and I want to suport it.