Skip to content

Commit

Permalink
feat: preserve 'use client' directives
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprevot committed Apr 12, 2024
1 parent e877991 commit 84c7398
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions packages/fractal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"postcss-styled-syntax": "^0.6.4",
"prettier": "^3.2.5",
"remark-gfm": "^4.0.0",
"rollup-plugin-preserve-directives": "^0.4.0",
"storybook": "^8.0.8",
"tsup": "^8.0.2",
"typescript": "^5.4.5",
Expand Down
3 changes: 2 additions & 1 deletion packages/fractal/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const commonConfig: Options = {
replaceNodeEnv: true,
sourcemap: true,
target: 'esnext',
treeshake: true,
tsconfig: path.resolve(__dirname, './tsconfig.build.json'),
}

Expand All @@ -37,6 +36,8 @@ export default defineConfig([
'./src/index.ts',
'./src/constants.ts',
'./src/types.ts',
'./src/ThemeProvider.tsx',
'./src/hooks/index.ts',
'./src/styles/helpers.ts',
'./src/components/index.ts',
'./src/components/**/index.ts',
Expand Down
3 changes: 3 additions & 0 deletions packages/fractal/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'node:path'

import react from '@vitejs/plugin-react-swc'
import preserveDirectives from 'rollup-plugin-preserve-directives'
import { type Plugin, defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'

Expand Down Expand Up @@ -69,7 +70,9 @@ export default defineConfig({
react: 'React',
'react-dom': 'ReactDOM',
},
preserveModules: true,
},
plugins: [preserveDirectives()],
},
},

Expand Down
23 changes: 18 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4141,7 +4141,7 @@ __metadata:
languageName: node
linkType: hard

"@rollup/pluginutils@npm:^5.0.2":
"@rollup/pluginutils@npm:^5.0.2, @rollup/pluginutils@npm:^5.1.0":
version: 5.1.0
resolution: "@rollup/pluginutils@npm:5.1.0"
dependencies:
Expand Down Expand Up @@ -4716,6 +4716,7 @@ __metadata:
react-dom: "npm:^18.2.0"
react-textarea-autosize: "npm:^8.5.3"
remark-gfm: "npm:^4.0.0"
rollup-plugin-preserve-directives: "npm:^0.4.0"
storybook: "npm:^8.0.8"
tailwind-merge: "npm:^2.2.2"
tailwindcss: "npm:^3.4.3"
Expand Down Expand Up @@ -15043,12 +15044,12 @@ __metadata:
languageName: node
linkType: hard

"magic-string@npm:^0.30.0, magic-string@npm:^0.30.7":
version: 0.30.8
resolution: "magic-string@npm:0.30.8"
"magic-string@npm:^0.30.0, magic-string@npm:^0.30.5, magic-string@npm:^0.30.7":
version: 0.30.9
resolution: "magic-string@npm:0.30.9"
dependencies:
"@jridgewell/sourcemap-codec": "npm:^1.4.15"
checksum: 10/72ab63817af600e92c19dc8489c1aa4a9599da00cfd59b2319709bd48fb0cf533fdf354bf140ac86e598dbd63e6b2cc83647fe8448f864a3eb6061c62c94e784
checksum: 10/a49b7f848e36914c2794e443d4da6579abebb3e57a5e98b1603958f4672d1435dc15261f70c2793e9b6d6c891191c83b9608322b48d0d76a9be32e73e039cc8a
languageName: node
linkType: hard

Expand Down Expand Up @@ -19797,6 +19798,18 @@ __metadata:
languageName: node
linkType: hard

"rollup-plugin-preserve-directives@npm:^0.4.0":
version: 0.4.0
resolution: "rollup-plugin-preserve-directives@npm:0.4.0"
dependencies:
"@rollup/pluginutils": "npm:^5.1.0"
magic-string: "npm:^0.30.5"
peerDependencies:
rollup: 2.x || 3.x || 4.x
checksum: 10/2ed0eeeb342ad87b9ec6c0521279c21b8680709e43da66b956cf111783852c01e167d463860b8e5a5b7385cf4d807d71d448eb9bf8179e1b336d777d6f7fe5b8
languageName: node
linkType: hard

"rollup@npm:^4.0.2, rollup@npm:^4.13.0":
version: 4.13.0
resolution: "rollup@npm:4.13.0"
Expand Down

0 comments on commit 84c7398

Please sign in to comment.