bovender/webpack.config.js

48 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2019-12-22 04:44:48 +00:00
const path = require('path');
2019-12-22 08:43:15 +00:00
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2019-12-22 04:44:48 +00:00
module.exports = {
entry: './src/component.js',
output: {
filename: 'component.js',
path: path.resolve(__dirname, 'assets'),
},
mode: 'production',
2019-12-22 08:43:15 +00:00
plugins: [new MiniCssExtractPlugin()],
2019-12-22 04:44:48 +00:00
module: {
rules: [
{
test: /\.[s]css$/,
use: [
'style-loader',
2019-12-22 08:43:15 +00:00
MiniCssExtractPlugin.loader,
2019-12-22 04:44:48 +00:00
'css-loader',
2019-12-22 09:26:03 +00:00
{
loader: 'postcss-loader',
options: {
plugins: function () { // postcss plugins, can be exported to postcss.config.js
return [
require('autoprefixer')
];
}
}
},
'sass-loader'
2019-12-22 04:44:48 +00:00
],
},
2019-12-23 05:54:13 +00:00
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
2019-12-22 04:44:48 +00:00
],
},
};