Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Bootstrap transformer changes the order of imports  #639

@sis0k0

Description

@sis0k0

This issue is only for the next version of nativescript-dev-webpack. The problem is not present in the official version of the plugin.

When building with AoT, we use a TypeScript transformer to replace the dynamic bootstrap with a static one. The transformer changes the order of imports in a file. Example:

before transformation

import { platformNativeScriptDynamic } from "nativescript-angular/platform"; import { AppModule } from "./app.module"; import "./shared/kinvey.common"; platformNativeScriptDynamic().bootstrapModule(AppModule);

after transformation

import "./shared/kinvey.common"; import { platformNativeScript } from "nativescript-angular/platform-static"; import { AppModuleNgFactory } from "./app.module.ngfactory"; platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);

This is a problem, because nativescript-angular/platform or nativescript-angular/platform-static should be the first import in the application. These modules contain important bootstrap logic that should be executed before anything else.

Metadata

Metadata

Labels

angularbugnextThe problem is only with a prerelease version.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions