refactor(react, react-router): build works on windows (#28904)

Issue number: Internal
---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

React and React Router packages do not build correctly on Windows
because certain dependencies were not marked as external.
## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- 3rd party packages are correctly marked as external


## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
This commit is contained in:
Liam DeBeasi
2024-01-29 13:15:50 -05:00
committed by GitHub
parent 9448783bb1
commit b1c4c72474
2 changed files with 4 additions and 2 deletions

View File

@@ -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'),
};

View File

@@ -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'),
};