File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1
1
const { resolve, join } = require ( "path" ) ;
2
+ const fs = require ( 'fs' ) ;
2
3
3
4
const webpack = require ( "webpack" ) ;
4
5
const nsWebpack = require ( "nativescript-dev-webpack" ) ;
@@ -11,11 +12,13 @@ const { AotPlugin } = require("@ngtools/webpack");
11
12
12
13
const ngToolsWebpackOptions = { tsConfigPath : "tsconfig.aot.json" } ;
13
14
14
- const mainSheet = `app.css` ;
15
+ let mainSheet = '' ;
15
16
16
17
module . exports = env => {
17
18
const platform = getPlatform ( env ) ;
18
19
20
+ mainSheet = getMainSheet ( platform ) ;
21
+
19
22
// Default destination inside platforms/<platform>/...
20
23
const path = resolve ( nsWebpack . getAppPath ( platform ) ) ;
21
24
@@ -83,6 +86,12 @@ module.exports = env => {
83
86
} ;
84
87
85
88
89
+ function getMainSheet ( platform ) {
90
+ const mainSheet = `app.${ platform } .css` ;
91
+ return fs . existsSync ( join ( __dirname , 'app' , mainSheet ) ) ?
92
+ mainSheet : 'app.css' ;
93
+ }
94
+
86
95
function getPlatform ( env ) {
87
96
return env . android ? "android" :
88
97
env . ios ? "ios" :
Original file line number Diff line number Diff line change 1
1
const { resolve, join } = require ( "path" ) ;
2
+ const fs = require ( 'fs' ) ;
2
3
3
4
const webpack = require ( "webpack" ) ;
4
5
const nsWebpack = require ( "nativescript-dev-webpack" ) ;
@@ -8,11 +9,13 @@ const ExtractTextPlugin = require("extract-text-webpack-plugin");
8
9
const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
9
10
10
11
11
- const mainSheet = `app.css` ;
12
+ let mainSheet = '' ;
12
13
13
14
module . exports = env => {
14
15
const platform = getPlatform ( env ) ;
15
16
17
+ mainSheet = getMainSheet ( platform ) ;
18
+
16
19
// Default destination inside platforms/<platform>/...
17
20
const path = resolve ( nsWebpack . getAppPath ( platform ) ) ;
18
21
@@ -80,6 +83,12 @@ module.exports = env => {
80
83
} ;
81
84
82
85
86
+ function getMainSheet ( platform ) {
87
+ const mainSheet = `app.${ platform } .css` ;
88
+ return fs . existsSync ( join ( __dirname , 'app' , mainSheet ) ) ?
89
+ mainSheet : 'app.css' ;
90
+ }
91
+
83
92
function getPlatform ( env ) {
84
93
return env . android ? "android" :
85
94
env . ios ? "ios" :
Original file line number Diff line number Diff line change 1
1
const { resolve, join } = require ( "path" ) ;
2
+ const fs = require ( 'fs' ) ;
2
3
3
4
const webpack = require ( "webpack" ) ;
4
5
const nsWebpack = require ( "nativescript-dev-webpack" ) ;
@@ -8,11 +9,13 @@ const ExtractTextPlugin = require("extract-text-webpack-plugin");
8
9
const { BundleAnalyzerPlugin } = require ( "webpack-bundle-analyzer" ) ;
9
10
10
11
11
- const mainSheet = `app.css` ;
12
+ let mainSheet = '' ;
12
13
13
14
module . exports = env => {
14
15
const platform = getPlatform ( env ) ;
15
16
17
+ mainSheet = getMainSheet ( platform ) ;
18
+
16
19
// Default destination inside platforms/<platform>/...
17
20
const path = resolve ( nsWebpack . getAppPath ( platform ) ) ;
18
21
@@ -80,6 +83,12 @@ module.exports = env => {
80
83
} ;
81
84
82
85
86
+ function getMainSheet ( platform ) {
87
+ const mainSheet = `app.${ platform } .css` ;
88
+ return fs . existsSync ( join ( __dirname , 'app' , mainSheet ) ) ?
89
+ mainSheet : 'app.css' ;
90
+ }
91
+
83
92
function getPlatform ( env ) {
84
93
return env . android ? "android" :
85
94
env . ios ? "ios" :
You can’t perform that action at this time.
0 commit comments