forked from NangoHQ/nango
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
82 lines (81 loc) · 2.1 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
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin')
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development'
const resolve = { extensions: ['.ts', '.tsx', '.js'] }
const moduleConf = {
rules: [
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.ts(x?)$/,
use: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.views.build.json'
}
}
],
exclude: /node_modules/
}
]
}
module.exports = [
{
resolve: resolve,
mode: mode,
entry: { 'callback-script': './views/callback-script.ts' },
output: { path: __dirname + '/dist/views' },
plugins: [
new HtmlWebpackPlugin({
filename: 'callback.html',
template: './views/callback.html',
inlineSource: '.js$'
}),
new HtmlWebpackInlineSourcePlugin()
],
module: moduleConf
},
{
resolve: resolve,
mode: mode,
entry: { 'iframe-script': './views/iframe-script.ts' },
output: { path: __dirname + '/dist/views' },
plugins: [
new HtmlWebpackPlugin({
filename: 'iframe.html',
template: './views/iframe.html',
inlineSource: '.js$'
}),
new HtmlWebpackInlineSourcePlugin()
],
module: moduleConf
},
{
mode: mode,
entry: { 'error-script': './views/error-script.ts' },
output: { path: __dirname + '/dist/views' },
plugins: [
new HtmlWebpackPlugin({
template: './views/page-not-found-error.html',
filename: 'page-not-found-error.html',
inlineSource: '.js$'
}),
new HtmlWebpackPlugin({
template: './views/callback-url-request-error.html',
filename: 'callback-url-request-error.html',
inlineSource: '.js$'
}),
new HtmlWebpackPlugin({
template: './views/oauth-error.html',
filename: 'oauth-error.html',
inlineSource: '.js$'
}),
new HtmlWebpackInlineSourcePlugin()
],
resolve: resolve,
module: moduleConf
}
]