-
Next.js 12 has a new Rust compiler that does not support Babel.
There is already aliasing in Webpack and as I manually checked, babel-plugin-react-native-web actually makes the build slightly bigger (around 4 kB). So my question is, is babel-plugin-react-native-web still recommended? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
@steida Any revelations on this one? :) |
Beta Was this translation helpful? Give feedback.
-
Btw... here's the relevant documentation: https://nextjs.org/docs/advanced-features/compiler#unsupported-features |
Beta Was this translation helpful? Give feedback.
-
I think the babel-plugin-react-native-web is not necessary in many cases in the term of tree shaking or keeping bundle size down. Actually, I confirmed removing all the unused code from react-native-web about the next.js example without using babel-plugin-react-native-web (only using the package aliasing). The total module size is 70.3kB, but the bundled size is only 14kB. bundlephobia also said that react-native-web package is tree shakeable. |
Beta Was this translation helpful? Give feedback.
I think the babel-plugin-react-native-web is not necessary in many cases in the term of tree shaking or keeping bundle size down.
Actually, I confirmed removing all the unused code from react-native-web about the next.js example without using babel-plugin-react-native-web (only using the package aliasing). The total module size is 70.3kB, but the bundled size is only 14kB.
bundlephobia also said that react-native-web package is tree shakeable.
https://bundlephobia.com/package/[email protected]