-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
87 lines (81 loc) · 2.35 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
81
82
83
84
85
86
var path = require('path');
var webpack = require('webpack');
var vtkRules = require('vtk.js/Utilities/config/dependency.js').webpack.core.rules;
// Optional if you want to load *.css and *.module.css files
// var cssRules = require('vtk.js/Utilities/config/dependency.js').webpack.css.rules;
var entry = path.join(__dirname, './src/index.js');
const sourcePath = path.join(__dirname, './src');
const outputPath = path.join(__dirname, './dist');
module.exports = {
entry,
output: {
path: outputPath,
filename: 'index.js',
libraryTarget: 'commonjs'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
].concat(vtkRules),
},
resolve: {
alias: {
'react': path.resolve(__dirname, './node_modules/react'),
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
'react-router-dom': path.resolve(__dirname, './node_modules/react-router-dom'),
'react-redux': path.resolve(__dirname, './node_modules/react-redux'),
'react-bootstrap': path.resolve(__dirname, './node_modules/react-bootstrap'),
'react-jwt-auth': path.resolve(__dirname, './node_modules/react-jwt-auth'),
'react-feather': path.resolve(__dirname, './node_modules/react-feather')
}
},
externals: {
"med-img-reader": {
commonjs: "med-img-reader"
},
react: {
commonjs: "react",
commonjs2: "react",
amd: "React",
root: "React"
},
"react-dom": {
commonjs: "react-dom",
commonjs2: "react-dom",
amd: "ReactDOM",
root: "ReactDOM"
},
"react-router-dom": {
commonjs: "react-router-dom",
commonjs2: "react-router-dom"
},
"react-redux": {
commonjs: "react-redux",
commonjs2: "react-redux"
},
"react-bootstrap": {
commonjs: "react-bootstrap",
commonjs2: "react-bootstrap"
},
"react-jwt-auth": {
commonjs: "react-jwt-auth",
commonjs2: "react-jwt-auth"
},
"react-feather":{
commonjs: "react-feather",
commonjs2: "react-feather"
}
}
};