From b1c4c724745bd350cbf8b95c1e23f053dc8d6236 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 29 Jan 2024 13:15:50 -0500 Subject: [PATCH] refactor(react, react-router): build works on windows (#28904) Issue number: Internal --------- ## What is the current behavior? React and React Router packages do not build correctly on Windows because certain dependencies were not marked as external. ## What is the new behavior? - 3rd party packages are correctly marked as external ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information --- packages/react-router/rollup.config.mjs | 3 ++- packages/react/rollup.config.mjs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-router/rollup.config.mjs b/packages/react-router/rollup.config.mjs index d9ccf1f4af..6647b5197a 100644 --- a/packages/react-router/rollup.config.mjs +++ b/packages/react-router/rollup.config.mjs @@ -1,4 +1,5 @@ import typescript from '@rollup/plugin-typescript'; +const external = ['react', 'react-dom', 'react-router', 'react-router-dom', 'history', 'tslib']; export default { input: 'src/index.ts', @@ -9,8 +10,8 @@ export default { sourcemap: true, } ], - external: (id) => !/^(\.|\/)/.test(id), plugins: [ typescript(), ], + external: id => external.includes(id) || id.startsWith('@ionic/core') || id.startsWith('ionicons') || id.startsWith('@ionic/react'), }; diff --git a/packages/react/rollup.config.mjs b/packages/react/rollup.config.mjs index 71f731bdf2..4a5ae0f419 100644 --- a/packages/react/rollup.config.mjs +++ b/packages/react/rollup.config.mjs @@ -1,4 +1,5 @@ import typescript from '@rollup/plugin-typescript'; +const external = ['react', 'react-dom', 'react-router', 'react-router-dom', 'history', 'tslib']; export default { input: 'src/index.ts', @@ -11,8 +12,8 @@ export default { sourcemap: true, } ], - external: (id) => !/^(\.|\/)/.test(id), plugins: [ typescript(), ], + external: id => external.includes(id) || id.startsWith('@ionic/core') || id.startsWith('ionicons'), };