Closed CharlesJu1 closed 6 years ago
Hi @CharlesJu1, I've tested your changes and AFAIK they are rock-solid! The embedded demo app doesn't contain a lot of test-packages, but at least those that I can check work just fine.
Thanks for your efforts! I'm publishing 0.6.0 now.
I wonder if this change affects Webpack-builds by the way. I guess we'll learn soon.
As a bonus, this PR seemed to drastically reduce build time (from 10-12 minutes to 2 on our app)
@westlakem It sure does, because fi dev-dependencies and platform-specific files of irrelevant platforms are no longer parsed 🚀.
I gave it a try to make the plugin patch the node_modules in the platforms folder rather than the source folder. It seems working ok. Here is what I did:
In package.json, change the before_prepare hook to after_prepare hook and points to a new script file called patch_platform.js In patch_platform.js, require the platform specific patch-npm-packages.js. In patch-npm-packages.js, on line 227, require the package.json file from the source dir. The code logic is the same as before.