bovender/webpack.config.js

36 lines
820 B
JavaScript

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: './src/component.js',
output: {
filename: 'component.js',
path: path.resolve(__dirname, 'assets'),
},
mode: 'production',
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.[s]css$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'postcss-loader',
options: {
plugins: function () { // postcss plugins, can be exported to postcss.config.js
return [
require('autoprefixer')
];
}
}
},
'sass-loader'
],
},
],
},
};