Skip to content

Commit

Permalink
fix: align resolve.extensions with webpack builder (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored Sep 3, 2024
1 parent 028b3d3 commit 09cd950
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 738 deletions.
2 changes: 1 addition & 1 deletion packages/builder-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"add": "^2.0.6",
"pretty-hrtime": "^1.0.3",
"slash": "^5.0.0",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
12 changes: 11 additions & 1 deletion packages/builder-rsbuild/src/preview/iframe-rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ export default async (

config.resolve ??= {}
config.resolve.symlinks = !isPreservingSymlinks()
config.resolve.extensions = [
'.mjs',
'.js',
'.jsx',
'.ts',
'.tsx',
'.json',
'.cjs',
]

config.watchOptions = {
ignored: /node_modules/,
Expand Down Expand Up @@ -356,7 +365,8 @@ export default async (
inject: false,
template,
templateParameters: {
version: packageJson.version,
version:
packageJson?.version ?? '0.0.0-storybook-rsbuild-unknown-version',
globals: {
CONFIG_TYPE: configType,
LOGLEVEL: logLevel,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
},
"devDependencies": {
"@rsbuild/core": "1.0.1-beta.14",
"@storybook/types": "8.2.8",
"@storybook/types": "8.3.0-beta.2",
"@types/resolve": "^1.20.6",
"add": "^2.0.6",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue3-rsbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@rsbuild/core": "1.0.1-beta.14",
"@types/node": "^18.0.0",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"typescript": "^5.3.2"
},
"peerDependencies": {
Expand Down
1,252 changes: 544 additions & 708 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions sandboxes/react-16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-react": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/react": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/react": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@types/react": "^16",
"@types/react-dom": "^16",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"storybook-react-rsbuild": "workspace:*",
"typescript": "^5.3.2"
},
Expand Down
16 changes: 8 additions & 8 deletions sandboxes/react-18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-react": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/react": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/react": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@types/react": "^18",
"@types/react-dom": "^18",
"storybook": "8.2.8",
"storybook": "8.3.0-beta.2",
"storybook-react-rsbuild": "workspace:*",
"typescript": "^5.3.2"
}
Expand Down
2 changes: 1 addition & 1 deletion sandboxes/react-18/src/stories/Page.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const LoggedOut: Story = {}

// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
export const LoggedIn: Story = {
play: async ({ canvasElement }) => {
play: async ({ canvasElement }: any) => {
const canvas = within(canvasElement)
const loginButton = canvas.getByRole('button', { name: /Log in/i })
await expect(loginButton).toBeInTheDocument()
Expand Down
16 changes: 8 additions & 8 deletions sandboxes/vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"@chromatic-com/storybook": "^1.4.0",
"@rsbuild/core": "1.0.1-beta.14",
"@rsbuild/plugin-vue": "1.0.1-beta.14",
"@storybook/addon-essentials": "8.2.8",
"@storybook/addon-interactions": "8.2.8",
"@storybook/addon-links": "8.2.8",
"@storybook/addon-onboarding": "8.2.8",
"@storybook/blocks": "8.2.8",
"@storybook/test": "8.2.8",
"@storybook/vue3": "8.2.8",
"storybook": "8.2.8",
"@storybook/addon-essentials": "8.3.0-beta.2",
"@storybook/addon-interactions": "8.3.0-beta.2",
"@storybook/addon-links": "8.3.0-beta.2",
"@storybook/addon-onboarding": "8.3.0-beta.2",
"@storybook/blocks": "8.3.0-beta.2",
"@storybook/test": "8.3.0-beta.2",
"@storybook/vue3": "8.3.0-beta.2",
"storybook": "8.3.0-beta.2",
"storybook-vue3-rsbuild": "workspace:*",
"typescript": "^5.3.2"
}
Expand Down

0 comments on commit 09cd950

Please sign in to comment.