jizy-packer 2.1.44 → 2.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_package/.gitignore.skel +1 -2
- package/_package/.npmignore.skel +1 -4
- package/lib/Build.js +5 -0
- package/lib/Cli.js +6 -0
- package/lib/Config.js +6 -1
- package/package.json +1 -1
package/_package/.gitignore.skel
CHANGED
package/_package/.npmignore.skel
CHANGED
package/lib/Build.js
CHANGED
|
@@ -28,6 +28,7 @@ export default async function jPackBuild({
|
|
|
28
28
|
action = null,
|
|
29
29
|
name = null,
|
|
30
30
|
config = null,
|
|
31
|
+
target = null,
|
|
31
32
|
debug = false
|
|
32
33
|
} = {}) {
|
|
33
34
|
|
|
@@ -69,6 +70,10 @@ export default async function jPackBuild({
|
|
|
69
70
|
jPackConfig.set('action', action);
|
|
70
71
|
jPackConfig.set('debug', debug);
|
|
71
72
|
|
|
73
|
+
if (target) {
|
|
74
|
+
jPackConfig.set('customTarget', target);
|
|
75
|
+
}
|
|
76
|
+
|
|
72
77
|
if (config) {
|
|
73
78
|
LogMe.log('Build config');
|
|
74
79
|
try {
|
package/lib/Cli.js
CHANGED
|
@@ -27,6 +27,12 @@ const jPackCli = function (jPackData) {
|
|
|
27
27
|
description: 'Custom config absolute path or json string',
|
|
28
28
|
default: '',
|
|
29
29
|
})
|
|
30
|
+
.option('target', {
|
|
31
|
+
alias: 't',
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Custom target directory (absolute path)',
|
|
34
|
+
default: '',
|
|
35
|
+
})
|
|
30
36
|
.option('debug', {
|
|
31
37
|
alias: 'd',
|
|
32
38
|
type: 'boolean',
|
package/lib/Config.js
CHANGED
|
@@ -53,7 +53,12 @@ const jPackConfig = {
|
|
|
53
53
|
throw new Error('Invalid configuration: buildName is required.');
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
if (config.
|
|
56
|
+
if (config.customTarget) {
|
|
57
|
+
config.targetPath = path.resolve(config.customTarget);
|
|
58
|
+
config.targetRelativePath = config.targetPath;
|
|
59
|
+
config.importPrefix = path.relative(config.targetPath, config.basePath).replace(/\\/g, '/') + '/';
|
|
60
|
+
}
|
|
61
|
+
else if (config.action === 'dist') {
|
|
57
62
|
config.importPrefix = '../';
|
|
58
63
|
config.targetRelativePath = 'dist';
|
|
59
64
|
config.targetPath = path.join(config.basePath, 'dist');
|