question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue-loader extract-text-webpack-plugin but webpack 4 needs requires mini-css-extract-plugin

See original GitHub issue

Version

14.2.2

Reproduction link

[http://example.com# It needs a build setup, since this is vue-loader / webpack specific](http://example.com# It needs a build setup, since this is vue-loader / webpack specific)

Steps to reproduce

Create a webpack 4 vue project.

Attempt to use vue-loader and extact CSS with a supported plugin:

webpack.config.js:

const miniCssExtractPlugin = new MiniCssExtractPlugin({
        filename: '../CSS/[name].css',
        chunkFilename: '../CSS/[id].css',
        sourceMap: !isProduction()
    });

[…]

            rules: [
                {
                    test: /\.vue$/,
                    loader: 'vue-loader',
                    options: {
                        extractCSS: miniCssExtractPlugin,
                        cssSourceMap: !isProduction(),
                        postcss: {
                            config: postCSSLoaderOptions
                        }
                    }
                },
             ]

What is expected?

The build is expected to succeed. CSS is expected to be extracted by MiniCssExtractPlugin.

What is actually happening?

Build fails:

Module build failed: Error: [vue-loader] extractCSS: true requires extract-text-webpack-plugin as a peer dependency.

The problem: ETWP is not supporting webpack 4:

https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/701#issuecomment-374551300


Yes there is a ETWP beta (@next) which kinda-sorta seems to more-or-less run with webpack 4, BUT the entire project is being abandoned in favour of mini-css-extract-plugin . (Just read https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/701#issuecomment-374551300 )

Therefore, we have an unresolvable dependency until vue-loader starts supporting mini-css-extract-plugin to replace extract-text-webpack-plugin.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
Gourdbabycommented, Aug 24, 2018

so,how to resolve this question in the end?

1reaction
FranckFreiburgercommented, Nov 12, 2018

ping !

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found