React Native 生产应用程序是否包含 devDependencies?
Does React Native production app contain devDependencies?
我遇到了以下问题 https://github.com/callstack/react-native-testing-library/issues/955。生产构建失败,错误指向来自 devDependencies 的库。
Satyajit Sahoo 在 Reddit 上的回答。
The app contains what you import. Doesn't matter if it's in dependencies, devDependencies or you just created a file. Those fields are to tell npm/Yarn about what to install. Bundling looks only at your imports.
If your bundle contains code from testing library`, then you're importing it into some file that's imported by your entry point.
我遇到了以下问题 https://github.com/callstack/react-native-testing-library/issues/955。生产构建失败,错误指向来自 devDependencies 的库。
Satyajit Sahoo 在 Reddit 上的回答。
The app contains what you import. Doesn't matter if it's in dependencies, devDependencies or you just created a file. Those fields are to tell npm/Yarn about what to install. Bundling looks only at your imports.
If your bundle contains code from testing library`, then you're importing it into some file that's imported by your entry point.