-
Notifications
You must be signed in to change notification settings - Fork 77
/
webpack.config.js
47 lines (44 loc) · 1.06 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
const path = require('path');
var webpack = require('webpack')
var config = {
entry: './src/index',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
}
],
},
resolve: {
extensions: [
'.ts',
],
},
externals: [
// Don't bundle pixi.js, assume it'll be included in the HTML via a script
// tag, and made available in the global variable PIXI.
{"pixi.js": "PIXI"}
]
};
var packageConfig = Object.assign({}, config, {
output: {
filename: 'metacar.min.js',
path: path.resolve(__dirname, './dist'),
library: 'metacar',
libraryTarget: 'window',
libraryExport: 'default'
}
});
var demoConfig = Object.assign({}, config,{
output: {
filename: 'metacar.min.js',
path: path.resolve(__dirname, './demo/dist'),
library: 'metacar',
libraryTarget: 'window',
libraryExport: 'default'
}
});
module.exports = [
packageConfig, demoConfig,
];