This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11const path = require ( "path" ) ;
22const { existsSync } = require ( "fs" ) ;
3- const { findBootstrapModulePath } = require ( "./utils/ast-utils" ) ;
43const { ANDROID_APP_PATH } = require ( "./androidProjectHelpers" ) ;
54const {
65 getPackageJson,
@@ -41,14 +40,6 @@ exports.getEntryModule = function (appDirectory) {
4140 return entry ;
4241} ;
4342
44- exports . getMainModulePath = function ( entryFilePath ) {
45- try {
46- return findBootstrapModulePath ( entryFilePath ) ;
47- } catch ( e ) {
48- return null ;
49- }
50- }
51-
5243exports . getAppPath = ( platform , projectDir ) => {
5344 if ( isIos ( platform ) ) {
5445 const appName = path . basename ( projectDir ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const nsWebpack = require("nativescript-dev-webpack");
55const nativescriptTarget = require ( "nativescript-dev-webpack/nativescript-target" ) ;
66const { nsReplaceBootstrap } = require ( "nativescript-dev-webpack/transformers/ns-replace-bootstrap" ) ;
77const { nsReplaceLazyLoader } = require ( "nativescript-dev-webpack/transformers/ns-replace-lazy-loader" ) ;
8+ const { getMainModulePath } = require ( "nativescript-dev-webpack/utils/ast-utils" ) ;
89const CleanWebpackPlugin = require ( "clean-webpack-plugin" ) ;
910const CopyWebpackPlugin = require ( "copy-webpack-plugin" ) ;
1011const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
@@ -65,7 +66,7 @@ module.exports = env => {
6566 // directly from node_modules and the Angular modules loader won't be able to resolve the lazy routes
6667 // fixes https://github.com/NativeScript/nativescript-cli/issues/4024
6768 if ( env . externals . indexOf ( "@angular/core" ) > - 1 ) {
68- const appModuleRelativePath = nsWebpack . getMainModulePath ( resolve ( appFullPath , entryModule ) ) ;
69+ const appModuleRelativePath = getMainModulePath ( resolve ( appFullPath , entryModule ) ) ;
6970 if ( appModuleRelativePath ) {
7071 const appModuleFolderPath = dirname ( resolve ( appFullPath , appModuleRelativePath ) ) ;
7172 // include the lazy loader inside app module
Original file line number Diff line number Diff line change @@ -8,6 +8,14 @@ import * as ts from "typescript";
88import { readFileSync , existsSync } from "fs" ;
99import { collectDeepNodes } from "@ngtools/webpack/src/transformers" ;
1010
11+ export function getMainModulePath ( entryFilePath ) {
12+ try {
13+ return findBootstrapModulePath ( entryFilePath ) ;
14+ } catch ( e ) {
15+ return null ;
16+ }
17+ }
18+
1119export function findBootstrapModuleCall ( mainPath : string ) : ts . CallExpression | null {
1220 if ( ! existsSync ( mainPath ) ) {
1321 throw new Error ( `Main file (${ mainPath } ) not found` ) ;
You can’t perform that action at this time.
0 commit comments