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.
@@ -1,6 +1,5 @@
1
+ .work/
1
2
  build/*
2
3
  node_modules/
3
4
  test/
4
- vendor/
5
- composer.lock
6
5
  package-lock.json
@@ -1,12 +1,9 @@
1
+ .work/
1
2
  cli/
2
3
  config/
3
4
  example/
4
5
  node_modules/
5
- src/
6
- vendor/
7
6
  .babelrc
8
7
  .gitignore
9
- composer.json
10
- composer.lock
11
8
  me.json
12
9
  package-lock.json
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.action === 'dist') {
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');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jizy-packer",
3
- "version": "2.1.44",
3
+ "version": "2.1.45",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "_example",