diff --git a/index.html b/index.html index 9e6773df..960426ad 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@
- +
@@ -18,7 +18,6 @@ -

test

@@ -39,7 +38,5 @@

Waiting for JS load...

- - diff --git a/package.json b/package.json index df1278ba..33ae71a7 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "copy-webpack-plugin": "^8.0.0", "crypto-browserify": "^3.12.0", "events": "^3.2.0", + "html-webpack-plugin": "^5.3.1", "http-browserify": "^1.7.0", "http-server": "^0.12.3", "https-browserify": "^1.0.0", diff --git a/webpack.common.js b/webpack.common.js index d390387c..0d68a82f 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -1,6 +1,7 @@ const webpack = require('webpack') const path = require('path') const CopyPlugin = require('copy-webpack-plugin') +const HtmlWebpackPlugin = require('html-webpack-plugin') // https://webpack.js.org/guides/production/ const config = { @@ -40,6 +41,10 @@ const config = { } }, plugins: [ + new HtmlWebpackPlugin({ + template: 'index.html', + hash: true + }), // fix "process is not defined" error: new webpack.ProvidePlugin({ process: 'process/browser' @@ -53,7 +58,6 @@ const config = { ), new CopyPlugin({ patterns: [ - { from: path.join(__dirname, '/index.html'), to: './index.html' }, { from: path.join(__dirname, '/styles.css'), to: './styles.css' }, { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/blocksStates/'), to: './blocksStates/' }, { from: path.join(__dirname, '/node_modules/prismarine-viewer/public/textures/'), to: './textures/' },