-
-
Notifications
You must be signed in to change notification settings - Fork 40
feat: add webpack4 support #495
Conversation
NativeScriptModule
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
When building for Android the App_Resources for iOS should be copied to the dist directory and vice-versa.
- Remove tns-java-classes generation. - Concatenate multiple chunks in order to generate snapshot.
9c729c7
to
e0d0c32
Compare
e0d0c32
to
aae7a16
Compare
test
Disabling pathinfo results in faster builds/rebuilds (~2s).
test
So far the job that is triggered on windows is failing with error
`Entrypoint bundle = vendor.js bundle.js
Entrypoint vendor = common.js vendor.js
[./main.aot.ts] 0 bytes {bundle} [built]
[./vendor.ts] 0 bytes {common} [built]
ERROR in TypeError: Cannot read property 'map' of undefined
at AotCompiler.loadFilesAsync (C:\Jenkins\execroot\angular\packages\compiler\src\aot\compiler.ts:202:41)
at C:\Jenkins\workspace\PR-webpack-angular-app-android-win\nativescript-dev-webpack\demo\AngularApp\packages\compiler-cli\src\transformers\program.ts:183:32
at
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Webpack compilation complete.
Executing webpack failed with exit code 2.`
@SvetoslavTsenov , can you share the package.json and the webpack config? The ngtools/webpack plugin may not be updated.
@sis0k0 demo apps' dependencies are now updated.
test
test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need some follow-up PRs to finish this.
test
test nativescript_angular@rc
Support for webpack 4 and angular@6