This repository was archived by the owner on Aug 7, 2021. It is now read-only.
File tree 3 files changed +18
-12
lines changed
plugins/NativeScriptSnapshotPlugin
3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ module.exports = function (hookArgs) {
12
12
release : hookArgs . prepareData . release
13
13
} ;
14
14
15
- if ( env . snapshot && shouldSnapshot ( shouldSnapshotOptions ) ) {
15
+ if ( env . snapshot &&
16
+ shouldSnapshot ( shouldSnapshotOptions ) &&
17
+ ( ! hookArgs . prepareData ||
18
+ ! hookArgs . prepareData . nativePrepare ||
19
+ ! hookArgs . prepareData . nativePrepare . skipNativePrepare ) ) {
20
+
16
21
installSnapshotArtefacts ( hookArgs . prepareData . projectDir ) ;
17
22
}
18
23
}
Original file line number Diff line number Diff line change @@ -21,9 +21,19 @@ function warn(message) {
21
21
}
22
22
}
23
23
24
+ function ensureDirectoryExistence ( filePath ) {
25
+ var dir = dirname ( filePath ) ;
26
+ if ( existsSync ( dir ) ) {
27
+ return true ;
28
+ }
29
+ ensureDirectoryExistence ( dir ) ;
30
+ mkdirSync ( dir ) ;
31
+ }
32
+
24
33
module . exports = {
25
34
shouldSnapshot,
26
35
convertToUnixPath,
27
36
isWinOS,
28
- warn
37
+ warn,
38
+ ensureDirectoryExistence
29
39
} ;
Original file line number Diff line number Diff line change 8
8
ANDROID_PROJECT_DIR ,
9
9
ANDROID_APP_PATH ,
10
10
} = require ( "../../androidProjectHelpers" ) ;
11
+ const { ensureDirectoryExistence } = require ( "../../lib/utils" ) ;
11
12
const schema = require ( "./options.json" ) ;
12
13
13
14
const SNAPSHOT_ENTRY_NAME = "snapshot-entry" ;
@@ -69,16 +70,6 @@ exports.NativeScriptSnapshotPlugin = (function () {
69
70
// ensure that the runtime is installed only in the snapshotted chunk
70
71
webpackConfig . optimization . runtimeChunk = { name : SNAPSHOT_ENTRY_NAME } ;
71
72
}
72
-
73
- function ensureDirectoryExistence ( filePath ) {
74
- var dir = dirname ( filePath ) ;
75
- if ( existsSync ( dir ) ) {
76
- return true ;
77
- }
78
- ensureDirectoryExistence ( dir ) ;
79
- mkdirSync ( dir ) ;
80
- }
81
-
82
73
NativeScriptSnapshotPlugin . getInternalRequireModules = function ( webpackContext ) {
83
74
const packageJson = getPackageJson ( webpackContext ) ;
84
75
return ( packageJson && packageJson [ "android" ] && packageJson [ "android" ] [ "requireModules" ] ) || [ ] ;
You can’t perform that action at this time.
0 commit comments