-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·59 lines (58 loc) · 1.43 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
const webpack = require('webpack');
const path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
"custom/app": "./src/app.js",
"host": "./host/host.ts",
},
output: {
pathinfo: true,
publicPath: "/",
devtoolModuleFilenameTemplate: info =>
path.resolve(info.absoluteResourcePath)
},
devtool: 'source-map',
module: {
rules: [
{ // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
test: /\.tsx?$/,
loader: "awesome-typescript-loader"
},
{
test: /\.svg$/,
loader: "url-loader"
},
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
},
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
},
{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['@babel/preset-env', '@babel/react']
}
}
]
},
plugins: [
new HtmlWebpackPlugin({
hash: false,
template: './host/host.html',
filename: 'index.html',
chunks: []
})
],
"externals": {
"NDAPI": "window.ndapi",
"react": "window.ndapi.exports.React",
"bootstrap": "window.ndapi.exports.Bootstrap",
"@babel/polyfill": "window.ndapi.exports.babel.polyfill"
}
};