Answer the question
In order to leave comments, you need to log in
Why is the css file not being generated?
webpack:
module.exports = {
mode: "development",
entry: './src/script.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/index.html'
}),
new MiniCssExtractPlugin({
filename: '[name].css'
})
],
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.sass$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.js$/,
use: 'babel-loader'
},
{
test: /\.(png|jpg|jpeg|svg|gif)$/,
use: ['file-loader']
},
{
test: /\.(ttf|woff|woff2)$/,
use: ['file-loader']
}
]
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question