mirror of
https://github.com/typicode/json-server.git
synced 2025-07-27 20:23:34 +08:00
webpack 4 + preact (#786)
This commit is contained in:
21
webpack.config.js
Normal file
21
webpack.config.js
Normal file
@ -0,0 +1,21 @@
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||
|
||||
module.exports = {
|
||||
entry: './src/front/index.js',
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
|
||||
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(['dist']),
|
||||
new HtmlWebpackPlugin({
|
||||
favicon: 'src/front/favicon.ico',
|
||||
template: 'src/front/index.html'
|
||||
}),
|
||||
new MiniCssExtractPlugin()
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user