-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
50 lines (49 loc) · 1.4 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
const webpack = require('webpack')
const path = require('path')
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const p = process.env.NODE_ENV === 'production'
module.exports = {
target: 'web',
devtool: 'source-map',
entry: path.join(__dirname, 'src/scripts/index.js'),
output: {
path: path.join(__dirname, 'src/assets'),
filename: 'index.js'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js?$/,
loader: 'standard-loader',
exclude: /node_modules/,
options: {
parser: 'babel-eslint'
}
},
{
test: /\.js$/,
exclude: /node_modules/,
include: path.join(__dirname, 'src/scripts'),
loaders: ['babel-loader']
}
]
},
resolve: {
alias: {
slater: path.join(__dirname, 'src/scripts/', 'slater'),
micromanagerRoot: path.join(__dirname, 'src/scripts'),
components: path.join(__dirname, 'src/scripts/', 'components'),
pages: path.join(__dirname, 'src/scripts/', 'pages'),
templates: path.join(__dirname, 'src/scripts/', 'templates'),
lib: path.join(__dirname, 'src/scripts/', 'lib')
}
},
plugins: p ? [
new webpack.NoEmitOnErrorsPlugin(),
new LodashModuleReplacementPlugin(),
new UglifyJsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
] : []
};