Files
mue/webpack.common.js
2021-06-22 19:45:13 +01:00

45 lines
900 B
JavaScript

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: path.resolve(__dirname, './src/index.js'),
performance: {
hints: false
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.(sa|sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: ''
},
},
'css-loader',
'sass-loader'
],
},
{
test: /\.(woff|woff2|svg)$/,
type: 'asset/resource'
}
]
},
resolve: {
extensions: ['.js', '.jsx']
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].[chunkhash].css',
chunkFilename: '[id].[chunkhash].chunk.css'
}),
]
};