wiki/editor/webpack.config.js

46 lines
1.0 KiB
JavaScript
Raw Normal View History

2019-08-25 10:34:47 +00:00
const path = require('path');
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2019-08-25 10:34:47 +00:00
module.exports = {
mode: 'development',
entry: {
index: './src/index.js'
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, '../dist')
2019-08-25 10:34:47 +00:00
},
module: {
rules: [
{
2019-08-25 12:45:43 +00:00
test: /\.s?css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
2020-05-20 21:08:34 +00:00
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
loader: "file-loader",
options: {
name: '[name].[ext]',
outputPath: 'font/'
}
2019-08-25 10:34:47 +00:00
}
]
},
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: "[id].css"
}),
2019-08-25 10:34:47 +00:00
],
devServer: {
contentBase: './dist',
hot: true
},
};