ericclemmons / ericclemmons/terse-webpack

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

Open
#34 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
213
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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?

2. `.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. (/home/mwolf/tools/terse-webpack/example/node_modules/@terse/webpack/node_modules/webpack/lib/ProvidePlugin.js:30:19).
```

3. 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.