NativeScript Ng2 Webpack - ts files not compling


#1

Hi,

I created a Angular2 Nativescript hello world project. I made few changes to the style and saved these. The ts file changes refelcted correctly in the js files.

I then implemented webpack with AOT. The package is correctly building on “npm run start-ios-bundle”, and the app displays on the emulator

However, now I find that any changes made to the ts files are no longer appearing in the js files on saving or even after build. To solve this, I tried including “compileOnSave”: true in tsconfig.json, but that is not helping.

How do I solve this issue?


#2

hi Katy - pinging @Pete.K for any help on Webpack - actually probably we need a solid webpack thread started…


#3

@Pete.K can you help with the above issue?


#4

You need to rebuild the app. From what i can see, webpack builds from the platforms folder, ie the compiled app via tns build ios.

Try swapping your run command to tns build ios && npm run start-ios-bundle. That works for me


#5

I don’t often Webpack my apps, as I only get as far as PoCs, but I don’t think you can do a continuous development with webpack on. We recommend webpacking before you are ready to ship. Therefore, the expected workflow is tns run android/ios up until you feel the app is ready for release, then you do a npm run start-ios-bundle, or do npm run start-ios-bundle -- --release and test your app, and how it behaved before releasing it to the store.