mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
[v5]: separate react entry point (#2303)
This commit is contained in:
parent
f8a4d58dbd
commit
05f35785f9
@ -58,6 +58,7 @@
|
||||
"build": "concurrently -m 8 'yarn:build:*'",
|
||||
"build:base": "rollup -c",
|
||||
"build:vanilla": "rollup -c --config-vanilla",
|
||||
"build:react": "rollup -c --config-react",
|
||||
"build:middleware": "rollup -c --config-middleware",
|
||||
"build:middleware:immer": "rollup -c --config-middleware_immer",
|
||||
"build:shallow": "rollup -c --config-shallow",
|
||||
|
||||
@ -8,7 +8,12 @@ const { default: esbuild } = require('rollup-plugin-esbuild')
|
||||
|
||||
const extensions = ['.js', '.ts', '.tsx']
|
||||
const { root } = path.parse(process.cwd())
|
||||
const entries = [{ find: /.*\/vanilla\.ts$/, replacement: 'zustand/vanilla' }]
|
||||
const entries = [
|
||||
{ find: /.*\/vanilla\/shallow\.ts$/, replacement: 'zustand/vanilla/shallow' },
|
||||
{ find: /.*\/react\/shallow\.ts$/, replacement: 'zustand/react/shallow' },
|
||||
{ find: /.*\/vanilla\.ts$/, replacement: 'zustand/vanilla' },
|
||||
{ find: /.*\/react\.ts$/, replacement: 'zustand/react' },
|
||||
]
|
||||
|
||||
function external(id) {
|
||||
return !id.startsWith('.') && !id.startsWith(root)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user