-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathwebpack.config.js
39 lines (37 loc) · 958 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
const webpack = require('webpack');
const path = require('path')
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const gitRevision = require('git-revision');
const packageFile = require('./package.json');
module.exports = {
mode: process.env.NODE_ENV || 'development',
context: path.join(__dirname, 'app'),
entry: './index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
optimization: {
minimize: false
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: [
{ from: './*.ico' },
{ from: './*.png' },
{ from: './*.css' },
{ from: './*.html' }
],
options: {
concurrency: 100,
},
}),
new webpack.DefinePlugin({
APP: JSON.stringify({
version: packageFile.version + '-' + gitRevision('hash')
}),
})
]
};