diff options
author | Immanuel Pasanec <immanuel.pasanec@compaso.de> | 2021-07-22 11:36:47 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-10-11 17:48:38 +0300 |
commit | aa07fc349c74daa25da10293f6e6405f161e8670 (patch) | |
tree | 9f44bef1656d0c9b798ccf9f1ab7ba579e46520d /webpack.js | |
parent | e2f8feed8cce52893cfadc936c4600631f960ea5 (diff) |
Distribute web assembly files
Signed-off-by: Immanuel Pasanec <immanuel.pasanec@compaso.de>
Diffstat (limited to 'webpack.js')
-rw-r--r-- | webpack.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/webpack.js b/webpack.js index ee1ac3b13..b9153a4e8 100644 --- a/webpack.js +++ b/webpack.js @@ -19,6 +19,8 @@ webpackConfig.entry = { deck: path.join(__dirname, 'src', 'deck.js'), } +webpackConfig.output.assetModuleFilename = '[name][ext]?v=[contenthash]' + // Edit JS rule webpackRules.RULE_JS.exclude = BabelLoaderExcludeNodeModulesExcept([ '@juliushaertl/vue-richtext', @@ -61,6 +63,21 @@ webpackConfig.module.rules.push({ }, }) +webpackConfig.module.rules.push({ + test: /\.wasm$/i, + type: 'asset/resource', +}) + +webpackConfig.module.rules.push({ + test: /\.tflite$/i, + type: 'asset/resource', +}) + +webpackConfig.module.rules.push({ + test: /\.worker\.js$/, + use: { loader: 'worker-loader' }, +}) + webpackConfig.optimization.minimizer = [ new TerserPlugin({ terserOptions: { |