diff --git a/webpack.config.js b/webpack.config.js index 6813de1187f..25f280a7d5c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const ScratchWebpackConfigBuilder = require('scratch-webpack-configuration'); -// const STATIC_PATH = process.env.STATIC_PATH || '/static'; +const ASSET_PATH = '/scratch-gui/'; const baseConfig = new ScratchWebpackConfigBuilder( { @@ -18,7 +18,6 @@ const baseConfig = new ScratchWebpackConfigBuilder( .setTarget('browserslist') .merge({ output: { - assetModuleFilename: 'static/assets/[name].[hash][ext][query]', library: { name: 'GUI', type: 'umd2' @@ -34,7 +33,11 @@ const baseConfig = new ScratchWebpackConfigBuilder( .addModuleRule({ test: /\.(svg|png|wav|mp3|gif|jpg)$/, resourceQuery: /^$/, // reject any query string - type: 'asset' // let webpack decide on the best type of asset + type: 'asset', // let webpack decide on the best type of asset + generator: { + filename: 'static/assets/[name].[hash][ext][query]', + publicPath: ASSET_PATH, + }, }) .addPlugin(new webpack.DefinePlugin({ 'process.env.DEBUG': Boolean(process.env.DEBUG),