merge-text-webpack icon indicating copy to clipboard operation
merge-text-webpack copied to clipboard

Working with webpack manifests

Open drwpow opened this issue 8 years ago • 3 comments

Used the out-of-the-box config, but it doesn’t seem to add the file to webpack’s manifest.json in conjunction with webpack-manifest-plugin. Any pointers on how to alert the compiler manifest to the newly-created file?

drwpow avatar Jul 07 '17 17:07 drwpow

Here’s my webpack config:

plugins: [
    new MergeFilesPlugin({
      filename: 'application.css'
      test: /\.css/,
    }),
    new ManifestPlugin({
      publicPath: '/public',
      writeToFileEmit: true
    }),
],

merge-text-webpack is generating the application.css file just fine, and is also correctly removing the original 5 CSS files it was concatenating from both manifest.json and the output folder. However, even though application.css exists, it’s somehow the only file missing from manifest.json.

To reiterate: if you remove this plugin, the original 5 CSS files both get compiled and they’re present in manifest.json. But add this plugin, and now no CSS files are in manifest.json anymore though application.css is output. It’s like webpack doesn’t know about the new application.css file.

In my tests, this plugin is starting and finishing completely, every time, before ManifestPlugin (even though both are async).

drwpow avatar Jul 07 '17 19:07 drwpow

@dangodev @jtefera

I bet this problem is the same reason the generated combined file is not being picked up (and injected) by HtmlWebpackPlugin.

stereokai avatar Oct 25 '17 09:10 stereokai

@dangodev, @stereokai.

I know its been a while, but if anyone is still interested I've published a forked plugin that should solve this issue. file-merge-webpack-plugin.

adam-26 avatar Jan 23 '18 19:01 adam-26