webpack4 uses extract-text-webpack-plugin@4.0.0-beta.0 for style file extraction but does not generate a file. After installing extract-text-webpack-plugin@4.0.0-beta.0, it is found that it can be compiled successfully, but no css file is generated
configuration file is as follows:
const ExtractTextPlugin=require("extract-text-webpack-plugin");
const config={
entry:{
app:__dirname+"/src/app.js",
main:__dirname+"/src/index.js"
},
output:{
filename:"[name]-[hash].js",
path:__dirname+"/dist"
},
mode:"development",
devtool:"source-map",//source map
devServer:{//webpack
contentBase:"./dist",//webpack-dev-server
port:"8383",//
inline:true,//true
historyApiFallback:true,//HTML5 history APItrueindex.html
hot:true//
},
module:{
rules:[
{
test:/\.css$/,
use:[
{loader:"style-loader"},
{loader:"css-loader",
options:{
modules:true, //css modules
localIdentName:"[name]__[local]--[hash:base64:5]"// css
}
},
{loader:"postcss-loader"}
]
},
{
test:/\.less$/,
use:ExtractTextPlugin.extract({ //lesscss
fallback:"style-loader",
use:["css-loader","less-loader"]
})
},
{
test:/\.js$/,
use:{
loader:"babel-loader",
options:{
presets:["env"]
}
},
exclude:/node_modules/
},
{
test:/\.vue$/,
use:{
loader:"vue-loader"
}
}
]
},
resolve: {
alias: {
"vue": "vue/dist/vue.js"
}
},
plugins: [
new ExtractTextPlugin("css/index.css")
]
};
module.exports=config;
how is it that there is no corresponding index.css generation after executing the webpack command?