-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
webpack.config.js
45 lines (41 loc) · 885 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
42
43
44
45
let path = require("path");
let webpack = require("webpack");
let MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
var config = {
target: "web",
entry: "./frontend/main.js",
mode: 'production',
output: {
path: path.resolve(__dirname,"./Public/static/app"),
filename: "app.js",
publicPath: "/static/app/"
},
node: {
fs: "empty"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader"
}
},
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
},
plugins: [
new MonacoWebpackPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
]
}
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'source-map';
}
return config;
};