Answer the question
In order to leave comments, you need to log in
Why does webpack create 0. junk files?
Hello, here is the webpack code
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const cssLoaders = [
{
loader: MiniCssExtractPlugin.loader,
},
{loader: 'css-loader'},
{loader: 'postcss-loader'},
{loader: 'stylus-loader'}
]
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './index.js',
mode: 'development',
output: {
filename: "main.[hash].js",
path: path.resolve(__dirname, 'dist/')
},
resolve: {
extensions: ['.js'],
alias: {
'@': path.resolve(__dirname, 'src'),
'@core': path.resolve(__dirname, 'src/core')
}
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: "index.html"
}),
new CopyPlugin({
patterns: [
{
from: './favicon.ico',
to: path.resolve(__dirname, 'dist/')
},
]
}),
new MiniCssExtractPlugin({
filename: 'test.css',
})
],
module: {
rules: [
{
test: /\.styl(us)?$/,
use: cssLoaders
},
],
}
}
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