Skip to content

Commit

Permalink
chore: update the example
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Dec 18, 2024
1 parent 613168c commit 36048f8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/react-component-bundle/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineConfig({
],
output: {
target: 'web',
assetPrefix: 'auto', // FIXME: move this line to packages/core/src/asset/assetConfig.ts
},
plugins: [pluginReact(), pluginSass()],
});
2 changes: 1 addition & 1 deletion packages/core/src/asset/assetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const composeAssetConfig = (
output: {
// default: no inline asset
dataUriLimit: 0,
assetPrefix: 'auto', // we currently not support import asset in js because of 'auto' publicPath runtime
// assetPrefix: 'auto', // will turn on this with `preserveImport`
},
};
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/tests/__snapshots__/config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
},
"mode": "production",
"output": {
"dataUriLimit": 0,
"distPath": {
"css": "./",
"cssAsync": "./",
Expand Down Expand Up @@ -248,6 +249,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
},
"mode": "production",
"output": {
"dataUriLimit": 0,
"distPath": {
"css": "./",
"cssAsync": "./",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/react-component/index.pw.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'node:assert';
import fs from 'node:fs';
import path from 'node:path';
import { type Page, expect, test } from '@playwright/test';
import { dev } from 'test-helper/rsbuild';
import assert from 'node:assert';

function getCwdByExample(exampleName: string) {
return path.join(__dirname, '../../../examples', exampleName);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/react-component/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default defineConfig({
},
output: {
target: 'web',
dataUriLimit: 0
dataUriLimit: 0, // always emit asset for test
},
plugins: [
pluginReact({
Expand Down

0 comments on commit 36048f8

Please sign in to comment.