Skip to content

Commit 36048f8

Browse files
committed
chore: update the example
1 parent 613168c commit 36048f8

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

examples/react-component-bundle/rslib.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default defineConfig({
2525
],
2626
output: {
2727
target: 'web',
28+
assetPrefix: 'auto', // FIXME: move this line to packages/core/src/asset/assetConfig.ts
2829
},
2930
plugins: [pluginReact(), pluginSass()],
3031
});

packages/core/src/asset/assetConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const composeAssetConfig = (
1111
output: {
1212
// default: no inline asset
1313
dataUriLimit: 0,
14-
assetPrefix: 'auto', // we currently not support import asset in js because of 'auto' publicPath runtime
14+
// assetPrefix: 'auto', // will turn on this with `preserveImport`
1515
},
1616
};
1717
}

packages/core/tests/__snapshots__/config.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
99
},
1010
"mode": "production",
1111
"output": {
12+
"dataUriLimit": 0,
1213
"distPath": {
1314
"css": "./",
1415
"cssAsync": "./",
@@ -248,6 +249,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
248249
},
249250
"mode": "production",
250251
"output": {
252+
"dataUriLimit": 0,
251253
"distPath": {
252254
"css": "./",
253255
"cssAsync": "./",

tests/e2e/react-component/index.pw.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import assert from 'node:assert';
12
import fs from 'node:fs';
23
import path from 'node:path';
34
import { type Page, expect, test } from '@playwright/test';
45
import { dev } from 'test-helper/rsbuild';
5-
import assert from 'node:assert';
66

77
function getCwdByExample(exampleName: string) {
88
return path.join(__dirname, '../../../examples', exampleName);

tests/e2e/react-component/rsbuild.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default defineConfig({
6262
},
6363
output: {
6464
target: 'web',
65-
dataUriLimit: 0
65+
dataUriLimit: 0, // always emit asset for test
6666
},
6767
plugins: [
6868
pluginReact({

0 commit comments

Comments
 (0)