-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
executable file
·55 lines (52 loc) · 1.36 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
54
55
const path = require('path');
const webpack = require('webpack');
const BundleTracker = require('webpack-bundle-tracker');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const ENTRY_PATH = './app/frontend/assets/js/';
module.exports = {
mode: 'production',
context: __dirname,
entry: {
main: [`${ENTRY_PATH}/index`],
profile: [`${ENTRY_PATH}/profile`],
practice: [`${ENTRY_PATH}/practice`],
practice_list: [`${ENTRY_PATH}/practice_list`],
dialog_export_practice: [`${ENTRY_PATH}/dialog_export_practices`],
dashboard: [`${ENTRY_PATH}/dashboard`],
},
output: {
path: path.resolve('./app/frontend/static/app/assets/bundles/'),
publicPath: '/static/assets/bundles/',
filename: "[name].js",
libraryTarget: "global"
},
module: {
rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
],
},
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
],
},
plugins: [
new BundleTracker({filename: './webpack-stats.json'}),
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
}),
]
}