Skip to content

Commit

Permalink
fix: asset paths in dev mode (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Aug 13, 2024
1 parent 969db62 commit 4cf5835
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/builder-rsbuild/src/preview/iframe-rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export default async (
const merged = mergeRsbuildConfig(contentFromConfig, {
output: {
cleanDistPath: false,
assetPrefix: '/',
dataUriLimit: {
media: 10000,
},
Expand All @@ -221,7 +222,6 @@ export default async (
font: resourceFilename,
media: resourceFilename,
},
assetPrefix: '/',
externals,
},
server: {
Expand All @@ -230,7 +230,6 @@ export default async (
publicDir: false,
},
dev: {
assetPrefix: '',
progressBar: !quiet,
},
source: {
Expand Down Expand Up @@ -291,6 +290,13 @@ export default async (
config.watchOptions = {
ignored: /node_modules/,
}

if (!isProd) {
// Using publicPath here to force drop slash in assetPrefix.
config.output = config.output || {}
config.output.publicPath = ''
}

config.ignoreWarnings = [
...(config.ignoreWarnings || []),
/export '\S+' was not found in 'global'/,
Expand Down

0 comments on commit 4cf5835

Please sign in to comment.