-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (48 loc) · 1.06 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const config = {
module: {}
}
const process = [
{
...config,
name: 'all',
entry: {
all: './src',
middleware: './src/middleware',
pipeline: './src/pipeline',
observer: './src/observer'
},
output: {
filename: 'js/[name].min.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd'
}
}
]
module.exports = {
...process[0],
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'Pattern JS',
favicon: 'src-example/favicon.png',
template: 'src-example/index.html'
}),
new CopyPlugin({
patterns: [
path.resolve(__dirname, 'src-example', 'src')
]
})
],
// webpack-dev-server configurations
devServer: {
compress: true,
contentBase: path.join(__dirname, 'dist'),
open: true,
port: 9000
}
}