-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.test.config.js
68 lines (66 loc) · 2.08 KB
/
webpack.test.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
const path = require("path");
const packageJson = require("./package.json");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const cesiumSource = '../node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';
module.exports = {
devtool: "inline-source-map",
mode: "development",
context: path.join(__dirname, "app"),
entry: {
tests: "./src/test/app.test.ts"
},
output: {
path: path.join(__dirname, "test_bundle"),
filename: "dora" + "-[name].js",
library: "@dora/common",
libraryTarget: "umd",
sourcePrefix: ''
},
node: {
fs: 'empty'
},
amd: {
toUrlUndefined: true
},
resolve: {
extensions: ['.ts', '.js', '.html', '.css']
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader"
},
{
test: /\.less$/,
loader: ["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}}
]
},
plugins: [
new CopyWebpackPlugin([{from: path.join(cesiumSource, cesiumWorkers), to: 'Workers'},
{from: path.join(cesiumSource, 'Assets'), to: 'Assets'},
{from: path.join(cesiumSource, 'Widgets'), to: 'Widgets'},
{from: path.join(cesiumSource, 'ThirdParty'), to: 'ThirdParty'},
{from: 'src/test/test_assets', to: 'test_assets'}]),
new webpack.DefinePlugin({
CESIUM_BASE_URL: JSON.stringify('/')
})
]
};