-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
24 lines (23 loc) · 917 Bytes
/
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
const PACKAGE = require('./package.json');
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HTMLWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')
const path = require('path');
const buildPath = path.resolve(__dirname, 'build');
module.exports = {
entry: './src/index.ts',
mode: 'development',
devtool: 'inline-source-map',
output: { path: buildPath },
module: { rules: [{ test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/ }] },
devServer: { contentBase: 'build', port: 3000, hot: true },
resolve: { extensions: ['.ts', '.js'] },
plugins: [
new webpack.ProvidePlugin({
PIXI: 'pixi.js' // makes dragonbones work
}),
new CopyWebpackPlugin([{ from: 'assets', to: '' }]),
new HTMLWebpackPlugin(
{ template: 'assets/index.html', filename: 'index.html', templateParameters: { PACKAGE: PACKAGE, buildDate: new Date } })
]
}