Webpack 3.8.1 failed to extract CSS using Extract-text-webpack-plugin 3.0.2, error: ERROR in./src/static/style/localtime.css Module parse failed:unexpected token (1:0) your may need an appropriate loader T o Handle this file type. |. localtimebox {| color:red; |} @./node_modules/style-loader!. /src/static/style/localtime.css 4:14-42Webpack-build.config.js is configured as:
Module: { loaders: [ { test:/\.css$/, loader:ExtractTextPlugin.extract (' Style-loader ', ' Style-loader!css-loader ', {publicpath: '. /'}} ]},
Plugins: [ new Extracttextplugin (' Css/bundle.min.css ', {allchunks:true}),]
Workaround:
Change the webpack-build.config.js configuration to:
Module: { loaders: [ { test:/\.css$/, loader:ExtractTextPlugin.extract ({ fallback: ' Style-loader ', use : [' Css-loader '], publicpath: '. /'}} ]},
Plugins: [ new Extracttextplugin (' Css/bundle.min.css ', {allchunks:true}),]
The problem is solved. The specific reason seems to be the version of the problem.
Webpack 3.8 using Extract-text-webpack-plugin 3.0 to extract the CSS failed: may need a appropriate loader to handle the this file type.