-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathwebpack.config.js
36 lines (35 loc) · 939 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
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: [ 'babel-polyfill', path.resolve(__dirname, 'app/app.js') ],
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: './dat-medium.js',
},
module: {
rules: [
{ test: /\.js[x]?$/, exclude: /node_modules/, use: [ 'cache-loader', 'babel-loader' ] },
{ test: /\.css$/, exclude: /node_modules/, use: [ 'style-loader', 'css-loader' ] },
],
},
resolve: {
extensions: [ '.js', '.jsx' ],
modules: [
'node_modules',
path.resolve(__dirname, 'app'),
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: true,
sourceMap: true,
warningsFilter: () => false,
}),
new webpack.ProvidePlugin({
moment: 'moment/min/moment.min.js',
markdownIt: 'markdown-it/dist/markdown-it.min.js',
}),
],
}