forked from naorsabag/dora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
92 lines (89 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
83
84
85
86
87
88
89
90
91
92
const path = require( "path" );
const webpack = require( "webpack" );
const CopyWebpackPlugin = require( "copy-webpack-plugin" );
const cesiumSource = '/node_modules/cesium/Build/Cesium';
module.exports = {
context: path.join( __dirname, "demo" ),
entry: "./scripts/index.ts",
output: {
path: path.join( __dirname, "demo/dist" ),
publicPath: "/dist/",
filename: "demo.js",
libraryTarget: "umd",
sourcePrefix: ''
},
node: {
fs: 'empty'
},
amd: {
toUrlUndefined: true
},
resolve: {
extensions: [ '.ts', '.js', '.html', '.webpack.js', '.web.js', '.css' ],
},
module: {
unknownContextCritical: false,
rules: [ {
test: /\.tsx?$/,
loader: "ts-loader"
}, {
test: /\.less$/,
use: [ "style-loader", "css-loader", "less-loader" ]
}, {
test: /\.css$/,
use: [ "style-loader", "css-loader" ]
}, {
test: /\.svg$/,
loader: "svg-url-loader",
options: {
limit: 10000
}
}, {
test: require.resolve( "./app/vendor/earth-api-utility-library/extensions.js" ),
loader: "exports-loader?window.GEarthExtensions"
},
{
test: /\.(jpe?g|png|kml|gif|jpg|ico)$/,
loader: "url-loader",
options: {
limit: 10000
}
},
{
test: /mapbox-gl-rtl-text.min.js$/,
loader: 'file-loader'
}
]
},
plugins: [
new CopyWebpackPlugin( [ {
from: path.join( __dirname, cesiumSource, 'Workers' ),
to: path.join( __dirname, 'demo/Workers' )
}, {
from: path.join( __dirname, cesiumSource, 'Assets' ),
to: path.join( __dirname, 'demo/Assets' )
}, {
from: path.join( __dirname, cesiumSource, 'Widgets' ),
to: path.join( __dirname, 'demo/Widgets' )
}, {
from: path.join( __dirname, cesiumSource, 'ThirdParty' ),
to: path.join( __dirname, 'demo/ThirdParty' )
},
{
from: path.join( __dirname, 'app/assets/fonts' ),
to: path.join( __dirname, 'demo/fonts' )
}
] ),
new webpack.DefinePlugin( {
CESIUM_BASE_URL: JSON.stringify( '/' )
} )
],
devtool: "inline-source-map",
devServer: {
inline: true,
hot: true,
contentBase: path.join( __dirname, "demo" ),
port: 88
},
mode: "development"
};