jizy-packer 2.1.2 → 2.1.3
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/README.md +23 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ A CLI tool and Node.js library to generate optimized builds for your projects. I
|
|
|
15
15
|
### CLI
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
node
|
|
19
|
-
node
|
|
20
|
-
node
|
|
18
|
+
node ./cli/jpack.js --debug
|
|
19
|
+
node ./cli/jpack.js --action build --name perso --config { "key": "value" }
|
|
20
|
+
node ./cli/jpack.js --action build --name perso --config ABSOLUTE_PATH_TO_JSON_FILE
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Options:
|
|
@@ -45,11 +45,11 @@ Example from the "jizy-browser" extension.
|
|
|
45
45
|
|
|
46
46
|
***First for the default dist build***
|
|
47
47
|
|
|
48
|
-
#### ./
|
|
49
|
-
```
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
#### ./cli/jpack.js
|
|
49
|
+
```js
|
|
50
|
+
import { jPackCli } from 'jizy-packer';
|
|
51
|
+
import jPackData from '../config/jpack.js';
|
|
52
|
+
jPackCli(jPackData);
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
#### ./config/jpack.js
|
|
@@ -58,34 +58,28 @@ import fs from 'fs';
|
|
|
58
58
|
import path from 'path';
|
|
59
59
|
import { LogMe, jPackConfig } from 'jizy-packer';
|
|
60
60
|
|
|
61
|
-
const jPackData = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
// generate config.less
|
|
75
|
-
onGenerateBuildJs: (code) => {
|
|
61
|
+
const jPackData = function () {
|
|
62
|
+
jPackConfig.sets({
|
|
63
|
+
name: 'BrowserCompat',
|
|
64
|
+
alias: 'jizy-browser',
|
|
65
|
+
desktopBreakpoint: "900px"
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
jPackConfig.set('onCheckConfig', () => { });
|
|
69
|
+
|
|
70
|
+
jPackConfig.set('onGenerateBuildJs', (code) => {
|
|
76
71
|
LogMe.log('Generate config.less');
|
|
72
|
+
LogMe.log(' path: ' + path.join(jPackConfig.get('targetPath'), 'config.less'));
|
|
77
73
|
const desktopBreakpoint = jPackConfig.get('desktopBreakpoint') ?? '768px';
|
|
78
|
-
let lessContent = `@desktop-breakpoint: ${desktopBreakpoint}
|
|
74
|
+
let lessContent = `@desktop-breakpoint: ${desktopBreakpoint};` + "\n";
|
|
79
75
|
lessContent += `@mobile-breakpoint: @desktop-breakpoint - 1px;`;
|
|
80
76
|
fs.writeFileSync(path.join(jPackConfig.get('targetPath'), 'config.less'), lessContent);
|
|
81
77
|
return code;
|
|
82
|
-
}
|
|
78
|
+
});
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
onGenerateWrappedJs: (wrapped) => wrapped,
|
|
80
|
+
jPackConfig.set('onGenerateWrappedJs', (wrapped) => wrapped);
|
|
86
81
|
|
|
87
|
-
|
|
88
|
-
onPacked: () => { }
|
|
82
|
+
jPackConfig.set('onPacked', () => { });
|
|
89
83
|
};
|
|
90
84
|
|
|
91
85
|
export default jPackData;
|