-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.config.js
71 lines (70 loc) · 1.8 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
var webpack = require("webpack");
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
// entry point for your application code
main: [
'./src/app/main.ts'
],
// put your third party libs here
// vendor: []
},
output: {
path: '/dist',
filename: '[name].bundle.js',
// the bundled output will be loaded by the Dojo AMD loader
// that is included in the ArcGIS API for JavaScript
libraryTarget: 'amd'
},
resolve: {
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
'ts-loader'
]
},
// css
{
test: /\.css$/,
use: [
'style-loader!css-loader'
]
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
new HtmlWebpackPlugin({
inject: false, // we need to use the dojo loader
jsapiVersion: '3.17',
template: 'src/app/index.ejs'
})
],
externals: [
function(context, request, callback) {
if (/^dojo/.test(request) ||
/^dojox/.test(request) ||
/^dijit/.test(request) ||
/^esri/.test(request)
) {
return callback(null, "amd " + request);
}
callback();
}
],
devServer: {
contentBase: './dist',
historyApiFallback: true,
hot: true,
inline: true,
port: 8000
},
devtool: 'source-map'
};