Skip to content

Commit

Permalink
Merge pull request #30305 from storybookjs/dannyhw/fix-rnw-requires-s…
Browse files Browse the repository at this point in the history
…upport

RNW-Vite: Support requires for images/fonts
  • Loading branch information
shilman authored Jan 22, 2025
2 parents f3276d5 + c710465 commit 586641e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/frameworks/react-native-web-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@storybook/react-vite": "workspace:*",
"@vitejs/plugin-react": "^4.3.2",
"vite-plugin-babel": "^1.3.0",
"vite-plugin-commonjs": "^0.10.4",
"vite-tsconfig-paths": "^5.1.4"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions code/frameworks/react-native-web-vite/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { esbuildFlowPlugin, flowPlugin } from '@bunchtogether/vite-plugin-flow';
import react from '@vitejs/plugin-react';
import type { InlineConfig, PluginOption } from 'vite';
import babel from 'vite-plugin-babel';
import commonjs from 'vite-plugin-commonjs';
import tsconfigPaths from 'vite-tsconfig-paths';

import type { FrameworkOptions, StorybookConfig } from './types';
Expand Down Expand Up @@ -129,6 +130,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, options) =
}),
...plugins,
reactNativeWeb(),
commonjs(),
],
optimizeDeps: {
esbuildOptions: {
Expand Down
24 changes: 24 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8445,6 +8445,7 @@ __metadata:
"@vitejs/plugin-react": "npm:^4.3.2"
typescript: "npm:^5.3.2"
vite-plugin-babel: "npm:^1.3.0"
vite-plugin-commonjs: "npm:^0.10.4"
vite-tsconfig-paths: "npm:^5.1.4"
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
Expand Down Expand Up @@ -31691,6 +31692,29 @@ __metadata:
languageName: node
linkType: hard

"vite-plugin-commonjs@npm:^0.10.4":
version: 0.10.4
resolution: "vite-plugin-commonjs@npm:0.10.4"
dependencies:
acorn: "npm:^8.12.1"
magic-string: "npm:^0.30.11"
vite-plugin-dynamic-import: "npm:^1.6.0"
checksum: 10c0/074e0d7a1e8f20d605f1a02c53867706639ea5a9aac8657e8d90442f13cf86154a6ebc65de1f05eb62e1a98523422d5025f3b7ccaabe88c486bec12b45e5d136
languageName: node
linkType: hard

"vite-plugin-dynamic-import@npm:^1.6.0":
version: 1.6.0
resolution: "vite-plugin-dynamic-import@npm:1.6.0"
dependencies:
acorn: "npm:^8.12.1"
es-module-lexer: "npm:^1.5.4"
fast-glob: "npm:^3.3.2"
magic-string: "npm:^0.30.11"
checksum: 10c0/049f953b404157346e06a729eb055bc5b3630ac990bf36d52e6c44b1b223ac8e1f22fa1c44cadea55e7621366a0666439860fd4572f09c87daa45affd5dd15b6
languageName: node
linkType: hard

"vite-plugin-inspect@npm:^0.8.5":
version: 0.8.9
resolution: "vite-plugin-inspect@npm:0.8.9"
Expand Down

0 comments on commit 586641e

Please sign in to comment.