-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.tests.config.js
56 lines (53 loc) · 1.47 KB
/
webpack.tests.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
const path = require("path");
const glob = require("glob");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const dir = path.resolve(__dirname);
const tests = glob.sync("./test/**/*.ts");
module.exports = {
context: dir,
mode: "development",
entry: {
tests: glob.sync("./test/**/*.ts"),
},
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "./test/dist/"),
},
externals: {
//three: "THREE",
//leaflet: "L"
},
resolve: {
extensions: [".ts", ".tsx", ".webpack.js", ".web.ts", ".web.js", ".js"],
alias: {
"harp-leaflet$": path.resolve(__dirname, "./src/index.ts"),
"harp-leaflet": path.resolve(__dirname, "./src/"),
},
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {
onlyCompileBundledFiles: true,
compilerOptions: {
declaration: false,
},
},
},
],
},
plugins: [
new CopyWebpackPlugin([
path.join(__dirname, "test/index.html"),
require.resolve("three/build/three.min.js"),
require.resolve("mocha/mocha.js"),
require.resolve("mocha/mocha.css"),
]),
],
devServer: {
contentBase: path.resolve(__dirname, "test"),
open: true,
},
};