Update strategy caching bundle front js files with webpack
- Add HtmlWebpackPlugin to use template index html
This commit is contained in:
parent
f2d7a9a732
commit
244f87196e
5 changed files with 308 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.ts',
|
||||
|
@ -28,11 +29,16 @@ module.exports = {
|
|||
extensions: [ '.tsx', '.ts', '.js' ],
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
filename: '[name].[contenthash].js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
publicPath: '/'
|
||||
},
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin(
|
||||
{
|
||||
template: './dist/index.html'
|
||||
}
|
||||
),
|
||||
new webpack.ProvidePlugin({
|
||||
Phaser: 'phaser'
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue