This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 4 files changed +20
-10
lines changed
plugins/NativeScriptSnapshotPlugin 4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 1
1
module . exports = function ( source ) {
2
2
this . cacheable ( ) ;
3
- const { registerPages = true , loadCss = true } = this . query ;
3
+ const { angular = false , loadCss = true } = this . query ;
4
4
5
- if ( registerPages ) {
5
+ if ( ! angular ) {
6
6
source = `
7
7
require("nativescript-dev-webpack/register-modules");
8
8
${ source }
@@ -11,7 +11,7 @@ module.exports = function(source) {
11
11
12
12
if ( loadCss ) {
13
13
source = `
14
- require("nativescript-dev-webpack/load-application-css");
14
+ require("nativescript-dev-webpack/load-application-css")( ${ angular } ) ;
15
15
${ source }
16
16
` ;
17
17
}
Original file line number Diff line number Diff line change 1
- const application = require ( "tns-core-modules/application" ) ;
2
- require ( "tns-core-modules/ui/styling/style-scope" ) ;
1
+ module . exports = function ( isAngular ) {
2
+ const application = require ( "tns-core-modules/application" ) ;
3
+ require ( "tns-core-modules/ui/styling/style-scope" ) ;
3
4
4
- global . registerModule ( "./app.css" , ( ) => require ( "~/app" ) ) ;
5
- const appCssContext = require . context ( "~/" , false , / ^ \. \/ a p p \. ( c s s | s c s s | l e s s | s a s s ) $ / ) ;
6
- global . registerWebpackModules ( appCssContext ) ;
5
+ if ( isAngular ) {
6
+ global . registerModule ( "./app.css" , ( ) => require ( "~/app" ) ) ;
7
+ } else {
8
+ const appCssContext = require . context ( "~/" , false , / ^ \. \/ a p p \. ( c s s | s c s s | l e s s | s a s s ) $ / ) ;
9
+ global . registerWebpackModules ( appCssContext ) ;
10
+ }
7
11
8
- application . loadAppCss ( ) ;
12
+ application . loadAppCss ( ) ;
13
+ }
9
14
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ exports.NativeScriptSnapshotPlugin = (function() {
45
45
46
46
let snapshotEntryContent = "" ;
47
47
if ( includeApplicationCss ) {
48
- snapshotEntryContent += `require("nativescript-dev-webpack/load-application-css");` ;
48
+ snapshotEntryContent += `require("nativescript-dev-webpack/load-application-css")( ${ options . angular } ) ;` ;
49
49
}
50
50
snapshotEntryContent += [ ...requireModules , ...internalRequireModules ]
51
51
. map ( mod => `require('${ mod } ')` ) . join ( ";" ) ;
@@ -155,3 +155,4 @@ exports.NativeScriptSnapshotPlugin = (function() {
155
155
156
156
return NativeScriptSnapshotPlugin ;
157
157
} ) ( ) ;
158
+
Original file line number Diff line number Diff line change 4
4
"androidNdkPath" : {
5
5
"type" : " string"
6
6
},
7
+ "angular" : {
8
+ "type" : " boolean" ,
9
+ "default" : false
10
+ },
7
11
"chunk" : {
8
12
"type" : " string"
9
13
},
You can’t perform that action at this time.
0 commit comments