forked from TLmaK0/witcase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (47 loc) · 1.3 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
const path = require('path');
const phaserModulePath = path.join(__dirname, '/node_modules/phaser-ce/');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const glob = require("glob");
const HtmlWebpackExternalsPlugin = require('html-webpack-externals-plugin')
module.exports = [
{
externals: {
'@reactivex/rxjs': '@reactivex/rxjs',
'lodash': 'lodash'
},
entry: path.resolve(__dirname, 'src/index.ts'),
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'witcase.min.js',
library: '',
libraryTarget: 'commonjs'
},
resolve: {
extensions: ['.ts', '.tsx', '.js'],
modules: [ path.join(__dirname, 'node_modules'), path.join(__dirname, 'src') ]
},
module: {
loaders: [
{ test: /\.tsx?$/, loader: 'ts-loader' }
]
},
devtool: 'inline-source-map',
plugins: [
new DtsBundlePlugin(),
// new UglifyJSPlugin(),
]
}
];
function DtsBundlePlugin(){}
DtsBundlePlugin.prototype.apply = function (compiler) {
compiler.plugin('done', function(){
var dts = require('dts-bundle');
dts.bundle({
name: 'phaser-mvc',
main: 'dist/typings/**/*.d.ts',
out: '../index.d.ts',
removeSource: true,
outputAsModuleFolder: true // to use npm in-package typings
});
});
};