4

I have a project developed starting from this repository. I wasn't on top of updating my app with their updates which is what I should have done but I would update libraries depending on my need for a new version. I updated my app about two weeks ago or so with all their updates. I merged all the conflicts and fixed the errors until everything was working as expected.

In that repository, they updated to webpack 3 and started using dll as a way to build the app faster during development. My issue is that I can't build my dlls and the error that I'm getting is this: Error: DllPlugin: supply an Array as entry. Here is a minimal repository https://github.com/hyalkaf/DLLPluginError that is a copy of their repo but with an additional window. This minimal repo doesn't have much extra code except for a few lines to create an extra window.

To give context to this error, Here are the files that I think are relevant in the minimal repo.

webpack.config.base:

entry: {
    bundle: './app/index.jsx',
    worker: './app/worker.jsx',
    reportImage: './app/reportImage.jsx'
  },

webpack.config.renderer.dev.js

entry: {
    bundle: ['react-hot-loader/patch', `webpack-dev-server/client?http://localhost:${port}/`, 'webpack/hot/only-dev-server', path.join(__dirname, 'app/index.jsx')],
    worker: ['react-hot-loader/patch', `webpack-dev-server/client?http://localhost:${port}/`, 'webpack/hot/only-dev-server', path.join(__dirname, 'app/worker.jsx')]
  },

webpack.config.renderer.prod

entry: {
    bundle: ['babel-polyfill', './app/index.jsx'],
    worker: ['babel-polyfill', './app/worker.jsx']
  },

Then I have an extra html file called worker.html as well as worker.js under app directory. I also added a new window to main.dev.js file.

To reproduce the error, fork or clone the repo and run: npm run build-dll

Github issues that could are/could be related:

  1. https://github.com/chentsulin/electron-react-boilerplate/issues/1199
Yves M.
  • 29,855
  • 23
  • 108
  • 144
Kafo
  • 3,568
  • 1
  • 12
  • 19

1 Answers1

1

I'm not sure if you are asking a question, since you link to a post that contains a solution to the problem.

In case someone else stumbles upon this question, the workaround solution is to wrap all entrys in brackets.

Using the sample code provided in the question, webpack.config.base should be changed accordingly:

entry: {
    bundle: ['./app/index.jsx'],
    worker: ['./app/worker.jsx'],
    reportImage: ['./app/reportImage.jsx']
  },
imolit
  • 7,743
  • 3
  • 25
  • 29