-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
53 lines (46 loc) · 1.44 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
const {CheckerPlugin} = require('awesome-typescript-loader'),
webpack = require('webpack'),
fs = require('fs-extra'),
copy = require('copy'),
path = require("path"),
dts = require('dts-bundle');
function percentage_handler(percentage, msg) {
if (0 === percentage) {
console.log("Build started... Good luck!");
} else if (1 === percentage) {
dts.bundle({
name: 'primitive-primitives',
main: 'src/main.d.ts',
out: '../dist/main.d.ts',
});
}
}
module.exports = {
entry: './src/main.ts',
output: {
filename: '/dist/main.js',
libraryTarget: "umd"
},
// Currently we need to add '.ts' to the resolve.extensions array.
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', 'd.ts']
},
// Source maps support ('inline-source-map' also works)
devtool: 'source-map',
// Add the loader for .ts files.
module: {
loaders: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader'
},
{
test: /\.glsl$/,
loader: 'raw-loader'
}
]
},
plugins: [
new webpack.ProgressPlugin(percentage_handler),
]
};