Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand All @@ -18,7 +18,6 @@ const baseConfig = new ScratchWebpackConfigBuilder(
.setTarget('browserslist')
.merge({
output: {
assetModuleFilename: 'static/assets/[name].[hash][ext][query]',
library: {
name: 'GUI',
type: 'umd2'
Expand All @@ -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),
Expand Down
Loading