Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for webpack v4 #55

Open
mojoaxel opened this issue Mar 5, 2018 · 10 comments
Open

add support for webpack v4 #55

mojoaxel opened this issue Mar 5, 2018 · 10 comments

Comments

@mojoaxel
Copy link

mojoaxel commented Mar 5, 2018

Webpack v4 has been released.
At the moment only webpack version 3 is supported:

@IAMtheIAM
Copy link

Yes please, webpack 4 looks like it has many good features, we need chunk manifest plugin :-)

@rshackleton
Copy link

rshackleton commented Mar 19, 2018

Experiencing the same issue as mentioned in webpack-contrib/mini-css-extract-plugin#38, have narrowed the issue down to this plugin.

ERROR in chunk main [entry]
main-86b47c44b7412f8548be.css
Cannot read property 'chunkFilename' of undefined

@iki
Copy link

iki commented Apr 16, 2018

mojoaxel referenced this issue in malectro/chunk-manifest-webpack-plugin Apr 16, 2018
@bf
Copy link

bf commented Apr 27, 2018

Any update on this issue? Waiting to use it with webpack 4.

@outshineamaze
Copy link

#59 we can use this, which support webpack 4.8.3 +

@fightingtheboss
Copy link

I ended up removing my dependency on this package in favour of using HtmlWebpackPlugin with the following configs:

// webpack.config.js
...
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'webpack-common-manifest.json',
      template: 'manifest/template.html',
      inject: false,
    }),
  ],
<%# manifest/template.html %>
<%= JSON.stringify(webpack.assetsByChunkName) %>

This produced a JSON manifest referencing all chunks. You can use any of the other options for HtmlWebpackPlugin to select or exclude chunks, order, etc.

@4lph4-Ph4un
Copy link

@fightingtheboss, is some part of that configuration missing? What makes webpack -object accessible from that template.html?

@fightingtheboss
Copy link

That variable is provided by HtmlWebpackPlugin while rendering the template. You can see documentation on that at the bottom of this section: https://github.com/jantimon/html-webpack-plugin#writing-your-own-templates

Turns out there's a much simpler solution to this problem though, simply use this plugin: https://github.com/danethurber/webpack-manifest-plugin. No need for a custom template in that case.

@4lph4-Ph4un
Copy link

Ah! So it seems! I somehow missed that assuming it was solely for stats -object! Thanks for the trick! :) Unfortunately webpack-manifest-plugin is out of scope for me, since it has another compatibility issues currently related to my other configs (mainly splitChunks: 'all').

@niemyjski
Copy link

Can we get one of the pr's for this merged in. Some look better than others... Can't even npm install after upgrading to npm4 or 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants