-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
39 lines (38 loc) · 909 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* eslint-env node */
/* eslint-disable no-console */
const path = require('path');
const HtmlPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
devServer: {
inline: true,
stats: 'minimal'
},
devtool: 'cheap-module-eval-demo-map',
entry: {
style: './demo/style.css',
client: './demo/client.js'
},
output: {
path: path.resolve('./dist'),
filename: '[name].[chunkhash].js'
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: ['ts-loader']
},
{
test: /\.css$/,
exclude: /node_modules/,
use: [{ loader: MiniCssExtractPlugin.loader }, 'css-loader']
}
]
},
plugins: [
new MiniCssExtractPlugin({ filename: '[name].[contenthash].css' }),
new HtmlPlugin({ template: 'demo/index.html' })
]
};