* fix(webpack): Fail build in case of compilation errors. WebPack's own documentation states that the `err` object **will not** include compilation errors. https://webpack.js.org/api/node/#webpack This fix addresses compilation errors by setting the correct `process.exitCode` looking at the result of the `stats.hasErrors()` call. * fix(tsc): Ensure that TypeScript compilation errors are handled. The `async` flag of the `fork-ts-checker-webpack-plugin` will (by default in development mode) avoid reporting any errors detected by `tsc` back to webpack: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options > If `true` reports issues **after** webpack's compilation is done. > Thanks to that it doesn't block the compilation. The problem in this case is that any compilation error will be then undetectable by the `WatchStatePlugin` which will happily tell the NativeScript CLI to continue with the build process. * fix(cli): Do not send the `compilation` message to the CLI on errors. When the compilation fails, this patch will prevent for the `compilation` message to be sent back to the CLI, preventing broken builds hitting the device.
@nativescript/webpack rewrite
The rewrite allows us to simplify things, and introduce some breaking changes. Listing them here, so we can keep track of them - will be in the merge commit, and the release notes once we are ready.
BREAKING CHANGES:
-
package.jsonmain should now use a relative path to the package.json instead of the app directoryFor example (given we have a
srcdirectory where our app is):"main": "app.js"becomes"main": "src/app.js"OR"main": "src/app.ts"(whether using JS or TS)This simplifies things, and will allow ctrl/cmd + clicking on the filename in some editors.
-
postinstallscripts have been removed.The configuration will not need to change in the user projects between updates.
For existing projects we will provide an easy upgrade path, through
ns migrateand a binary in the package.For new projects
ns createshould create the config file by invoking a binary in the package. -
removed resolutions for short imports - use full imports instead.
For example:
import http from 'http' // becomes import { http } from '@nativescript/core'