forked from AMP-SCZ/dpdash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·80 lines (79 loc) · 2.14 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
require('@babel/register');
const webpack = require('webpack');
const path = require('path');
module.exports = {
target: 'web',
mode: process.env.NODE_ENV || 'production',
entry: {
study: './views/Study.render.react.js',
admin: './views/Admin.render.react.js',
main: './views/Main.render.react.js',
login: './views/Login.render.react.js',
register: './views/Register.render.react.js',
reset: './views/Resetpw.render.react.js',
account: './views/Account.render.react.js',
editConfig: './views/EditConfig.render.react.js',
config: './views/Config.render.react.js',
deepdive: './views/DeepDive.render.react.js',
graph: './views/Graph.render.react.js',
reportsList: './views/ReportsList.render.react.js',
editReport: './views/EditReport.render.react.js',
report: './views/Report.render.react.js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
options: {
plugins: [
'react-html-attrs',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-runtime', { legacy: true }]
],
presets: [
["@babel/preset-react", {
"runtime": "automatic"
}],
'@babel/preset-env',
],
cacheDirectory: true,
}
}],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
generator: {
filename: 'static/[hash][ext][query]'
}
},
],
},
optimization: {
minimize: true,
},
output: {
path: path.resolve(__dirname, 'public')+'/js/',
filename: '[name].min.js',
publicPath: path.resolve(__dirname, 'public')+'/js/',
},
resolve: {
fallback: {
fs: false,
net: false,
tls: false,
},
extensions: [".js", ".jsx"]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}
}),
],
};