This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 6 files changed +15
-8
lines changed
6 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,21 @@ exports.getAotEntryModule = function (appDirectory) {
25
25
return aotEntry ;
26
26
}
27
27
28
- exports . getEntryModule = function ( appDirectory ) {
28
+ exports . getEntryModule = function ( appDirectory , platform ) {
29
29
verifyEntryModuleDirectory ( appDirectory ) ;
30
30
31
31
const entry = getPackageJsonEntry ( appDirectory ) ;
32
32
33
33
const tsEntryPath = path . resolve ( appDirectory , `${ entry } .ts` ) ;
34
34
const jsEntryPath = path . resolve ( appDirectory , `${ entry } .js` ) ;
35
- if ( ! existsSync ( tsEntryPath ) && ! existsSync ( jsEntryPath ) ) {
35
+ let entryExists = existsSync ( tsEntryPath ) || existsSync ( jsEntryPath ) ;
36
+ if ( ! entryExists && platform ) {
37
+ const platformTsEntryPath = path . resolve ( appDirectory , `${ entry } .${ platform } .ts` ) ;
38
+ const platformJsEntryPath = path . resolve ( appDirectory , `${ entry } .${ platform } .js` ) ;
39
+ entryExists = existsSync ( platformTsEntryPath ) || existsSync ( platformJsEntryPath ) ;
40
+ }
41
+
42
+ if ( ! entryExists ) {
36
43
throw new Error ( `The entry module ${ entry } specified in ` +
37
44
`${ appDirectory } /package.json doesn't exist!` )
38
45
}
Original file line number Diff line number Diff line change 1
- import { parse , sep } from "path" ;
1
+ import { parse , join } from "path" ;
2
2
import { AngularCompilerPlugin } from "@ngtools/webpack" ;
3
3
4
4
export function getAngularCompilerPlugin ( platform : string ) : any {
@@ -14,7 +14,7 @@ export function getAngularCompilerPlugin(platform: string): any {
14
14
try {
15
15
if ( platform ) {
16
16
const parsed = parse ( file ) ;
17
- const platformFile = parsed . dir + sep + parsed . name + "." + platform + parsed . ext ;
17
+ const platformFile = join ( parsed . dir , ` ${ parsed . name } . ${ platform } ${ parsed . ext } ` ) ;
18
18
return super . getCompiledFile ( platformFile ) ; ;
19
19
}
20
20
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ module.exports = env => {
54
54
const appFullPath = resolve ( projectRoot , appPath ) ;
55
55
const appResourcesFullPath = resolve ( projectRoot , appResourcesPath ) ;
56
56
const tsConfigName = "tsconfig.tns.json" ;
57
- const entryModule = `${ nsWebpack . getEntryModule ( appFullPath ) } .ts` ;
57
+ const entryModule = `${ nsWebpack . getEntryModule ( appFullPath , platform ) } .ts` ;
58
58
const entryPath = `.${ sep } ${ entryModule } ` ;
59
59
const entries = { bundle : entryPath } ;
60
60
if ( platform === "ios" ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ module.exports = env => {
49
49
const appFullPath = resolve ( projectRoot , appPath ) ;
50
50
const appResourcesFullPath = resolve ( projectRoot , appResourcesPath ) ;
51
51
52
- const entryModule = nsWebpack . getEntryModule ( appFullPath ) ;
52
+ const entryModule = nsWebpack . getEntryModule ( appFullPath , platform ) ;
53
53
const entryPath = `.${ sep } ${ entryModule } .js` ;
54
54
const entries = { bundle : entryPath } ;
55
55
if ( platform === "ios" ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ module.exports = env => {
49
49
const appFullPath = resolve ( projectRoot , appPath ) ;
50
50
const appResourcesFullPath = resolve ( projectRoot , appResourcesPath ) ;
51
51
52
- const entryModule = nsWebpack . getEntryModule ( appFullPath ) ;
52
+ const entryModule = nsWebpack . getEntryModule ( appFullPath , platform ) ;
53
53
const entryPath = `.${ sep } ${ entryModule } .ts` ;
54
54
const entries = { bundle : entryPath } ;
55
55
if ( platform === "ios" ) {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ module.exports = env => {
56
56
const appFullPath = resolve ( projectRoot , appPath ) ;
57
57
const appResourcesFullPath = resolve ( projectRoot , appResourcesPath ) ;
58
58
59
- const entryModule = nsWebpack . getEntryModule ( appFullPath ) ;
59
+ const entryModule = nsWebpack . getEntryModule ( appFullPath , platform ) ;
60
60
const entryPath = `.${ sep } ${ entryModule } ` ;
61
61
const entries = { bundle : entryPath } ;
62
62
if ( platform === "ios" ) {
You can’t perform that action at this time.
0 commit comments