forked from tl-its-umich-edu/my-learning-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (40 loc) · 1020 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
40
41
const path = require('path')
const BundleTracker = require('webpack-bundle-tracker')
const isDevelopment = process.env.BABEL_ENV !== 'production'
module.exports = {
mode: isDevelopment ? 'development' : 'production',
entry: path.join(__dirname, 'assets/src/index'),
output: {
path: path.join(__dirname, 'assets/dist'),
filename: '[name]-[fullhash].js'
},
watchOptions: { poll: true },
devtool: isDevelopment ? 'inline-source-map' : false,
module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(bmp|gif|jpeg|png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader',
options: {
limit: 10000,
name: 'static/[name].[hash:8].[ext]'
}
}
]
},
plugins: [
new BundleTracker({
path: __dirname,
filename: 'webpack-stats.json'
})
]
}