Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

ManifestPlugin export missing config with two ExtractTextPlugin instance. #653

Closed
rdshoep opened this issue Oct 25, 2017 · 3 comments
Closed

Comments

@rdshoep
Copy link

rdshoep commented Oct 25, 2017

Hi,

When I use multiple ExtractTextPlugin instances, the ManifestPlugin export content missing some files. I have create a simple project to test, please help me to check. webpack-ExtractTextPlugin-test-demo

webpack.config.js

const commonExtractCss = new ExtractTextPlugin('common.[contenthash].css')
    , projectExtractCss = new ExtractTextPlugin('app.[contenthash].css')

//rules
    {
        test: /\.less$/,
        include: [path.resolve(__dirname, './src/app')],
        use: projectExtractCss.extract({
            fallback: "style-loader",
            use: [
                {loader: 'css-loader', options: {minimize: true, importLoaders: 1}},
                'less-loader'
            ]
        })
    },
    {
        test: /\.less$/,
        exclude: [path.resolve(__dirname, './src/app')],
        use: commonExtractCss.extract({
            fallback: "style-loader",
            use: [
                {loader: 'css-loader', options: {minimize: true, importLoaders: 1}},
                'less-loader'
            ]
        })
    }

//plugins
    commonExtractCss,
    projectExtractCss,
    new ManifestPlugin({
        basePath: '/dist/'
    })

then I excute webpack
build files:

dist/
      app.42327f4612b408fb1397.js
      app.aae5406c9767788b2bfc7abcd2881536.css
      common.971f848e8154ff6b2243ec1a1da4abc0.css
      manifest.json

manifest.json

{
  "/dist/app.js": "/dist/app.42327f4612b408fb1397.js",
  "/dist/app.css": "/dist/app.aae5406c9767788b2bfc7abcd2881536.css"
}

But I expected

{
  "/dist/app.js": "/dist/app.42327f4612b408fb1397.js",
   "/dist/app.css": "/dist/app.aae5406c9767788b2bfc7abcd2881536.css",

   //I need below content
   "/dist/common.css": "common.971f848e8154ff6b2243ec1a1da4abc0.css"
}

Any ideas?

@loheander
Copy link

I have the same problem when running
webpack: 3.6.0
extract-text-webpack-plugin: 3.0.2
webpack-manifest-plugin: 1.3.2

@alexander-akait
Copy link
Member

@jheander @rdshoep maybe related shellscape/webpack-manifest-plugin#30

@alexander-akait
Copy link
Member

DEPRECATED
Please use: https://github.com/webpack-contrib/mini-css-extract-plugin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants