mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
refactor(react): only ship es modules (#26044)
BREAKING CHANGE: `@ionic/react` and `@ionic/react-router` no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
This commit is contained in:
@ -25,6 +25,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
|
|||||||
- [Textarea](#version-7x-textarea)
|
- [Textarea](#version-7x-textarea)
|
||||||
- [Virtual Scroll](#version-7x-virtual-scroll)
|
- [Virtual Scroll](#version-7x-virtual-scroll)
|
||||||
- [JavaScript Frameworks](#version-7x-javascript-frameworks)
|
- [JavaScript Frameworks](#version-7x-javascript-frameworks)
|
||||||
|
- [React](#version-7x-react)
|
||||||
- [Vue](#version-7x-vue)
|
- [Vue](#version-7x-vue)
|
||||||
- [Utilities](#version-7x-utilities)
|
- [Utilities](#version-7x-utilities)
|
||||||
- [hidden attribute](#version-7x-hidden-attribute)
|
- [hidden attribute](#version-7x-hidden-attribute)
|
||||||
@ -143,6 +144,10 @@ Any references to the virtual scroll types from `@ionic/core` have been removed.
|
|||||||
|
|
||||||
<h2 id="version-7x-javascript-frameworks">JavaScript Frameworks</h2>
|
<h2 id="version-7x-javascript-frameworks">JavaScript Frameworks</h2>
|
||||||
|
|
||||||
|
<h4 id="version-7x-react">React</h4>
|
||||||
|
|
||||||
|
`@ionic/react` and `@ionic/react-router` no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
|
||||||
|
|
||||||
<h4 id="version-7x-vue">Vue</h4>
|
<h4 id="version-7x-vue">Vue</h4>
|
||||||
|
|
||||||
`@ionic/vue` and `@ionic/vue-router` no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
|
`@ionic/vue` and `@ionic/vue-router` no longer ship a CommonJS entry point. Instead, only an ES Module entry point is provided for improved compatibility with Vite.
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
"sync": "sh ./scripts/sync.sh"
|
"sync": "sh ./scripts/sync.sh"
|
||||||
},
|
},
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.esm.js",
|
|
||||||
"types": "dist/types/index.d.ts",
|
"types": "dist/types/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/"
|
"dist/"
|
||||||
|
@ -5,15 +5,10 @@ export default {
|
|||||||
input: 'dist-transpiled/index.js',
|
input: 'dist-transpiled/index.js',
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
file: 'dist/index.esm.js',
|
file: 'dist/index.js',
|
||||||
format: 'es',
|
format: 'es',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
}
|
||||||
{
|
|
||||||
file: 'dist/index.js',
|
|
||||||
format: 'commonjs',
|
|
||||||
sourcemap: true,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
external: (id) => !/^(\.|\/)/.test(id),
|
external: (id) => !/^(\.|\/)/.test(id),
|
||||||
plugins: [resolve(), sourcemaps()],
|
plugins: [resolve(), sourcemaps()],
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
"sync": "sh ./scripts/sync.sh"
|
"sync": "sh ./scripts/sync.sh"
|
||||||
},
|
},
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.esm.js",
|
|
||||||
"types": "dist/types/index.d.ts",
|
"types": "dist/types/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"dist/",
|
||||||
|
@ -10,17 +10,11 @@ export default {
|
|||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
dir: 'dist/',
|
dir: 'dist/',
|
||||||
entryFileNames: '[name].esm.js',
|
entryFileNames: '[name].js',
|
||||||
chunkFileNames: '[name]-[hash].esm.js',
|
chunkFileNames: '[name]-[hash].js',
|
||||||
format: 'es',
|
format: 'es',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
},
|
}
|
||||||
{
|
|
||||||
dir: 'dist/',
|
|
||||||
format: 'commonjs',
|
|
||||||
preferConst: true,
|
|
||||||
sourcemap: true,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
external: (id) => !/^(\.|\/)/.test(id),
|
external: (id) => !/^(\.|\/)/.test(id),
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Reference in New Issue
Block a user