You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENYO-3012: use packagejs: instead of source: in deploy.json
- the `source:` property of `deploy.json` did not make sense as it was
always refering to the folder where `deploy.json` is. it is now
replaced by a `packagejs:` property (default: `"package.js"`) which
indicates where is the relative location of the top-level
`package.js` from the project root folder.
Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <[email protected]>
Copy file name to clipboardExpand all lines: deploy.md
+81-16Lines changed: 81 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -19,34 +19,99 @@ Instead, the CSS url paths are fixed up to reference the new path from the build
19
19
20
20
### How to compress
21
21
22
-
To compress your application, you must run the Node.js script named `deploy.js` that comes with Enyo, as `enyo/tools/deploy.js`.
22
+
To compress your application, you must run the script named `deploy.js` that comes with Enyo, as `node enyo/tools/deploy.js`. Bootplate provides 2 wrappers scripts to shorten the minification learning curve. You can just run:
23
23
24
-
$ node enyo/tools/deploy.js -h
24
+
C:\path\to\bootplate\> cd tools
25
+
C:\path\to\bootplate\tools> deploy.bat
26
+
27
+
or (on Mac & Linux):
28
+
29
+
$ cd /path/to/bootplate/tools
30
+
$ bash ./deploy.sh
25
31
26
-
This script will run the minification tool located in `enyo/tools/minifier/minify.js`, and make a build of enyo, then a build of your app.
32
+
This script will run the minification tool located in `enyo/tools/minifier/deploy.js`, and make a build of enyo, then a build of your app.
27
33
28
34
Any libraries referenced in your `package.js` manifest will be built into your app's built code.
29
35
30
-
**NOTE:**`deploy.js` expects to find a `package.js` in the root-folder of your application. It only references your app's `package.js` to keep paths correct. Do not modify this.
36
+
**NOTE:**`deploy.js` expects to find a `deploy.json` manifest in the root-folder of your application. This manifest then defines where are (1) the top-level `package.js`, (2) the location of the Enyo framework within the applicatio source & what are the various libraries & assets. A typical default `package.json` contains:
After running the `deploy.js` script, a new folder `build` (you change this using the `-b` flag of the `deploy.js` script) will be located next to your `source` directory.
49
+
After running the `deploy.bat|sh` script, two new folders (`build` and `deploy`) will be located next to your `source` directory.
50
+
51
+
#### Minification test folder - build
52
+
53
+
```
54
+
build
55
+
├── app.css
56
+
├── app.js
57
+
├── enyo.css
58
+
└── enyo.js
59
+
```
35
60
36
-
In it will be 4 files:
37
-
- enyo.css
38
-
- enyo.js
39
-
- app.css
40
-
- app.js
61
+
These generated files will be loaded in the given order by `index.html`.
41
62
42
-
These files will be loaded in the given order by `index.html`.
63
+
#### Deployment folder - deploy
43
64
44
-
The output of the `deploy`scripts will minify your appliaction, and copy the necessary files into `deploy/<appname>/`.
65
+
The `deploy`folder contains a ready-to-be-shipped minified version of your application, including its declared assets & libraries in addition to the content of the `build folder`.
45
66
46
-
If the libraries have a compatible `deploy.sh` or `deploy.bat`script, they will be executed, and a minimal copy will be placed in the deployment's lib folder.
67
+
If the libraries have a compatible `deploy.json` (use to be `deploy.sh` or `deploy.bat`scripts), they will be used, and a minimal copy will be placed in the deployment's `./lib` folder.
47
68
48
-
If no `deploy.(sh|bat)` script is found for the library, all of the library is copied into the lib folder to provide maximum safety.
69
+
If no `deploy.(json|sh|bat)` script is found for the libraries, all of each library is copied into the `deploy/lib` folder to provide maximum safety.
49
70
50
-
If you are adding a library, please add a `deploy.sh` file and `deploy.bat` file similar to the ones in `lib/onyx`.
71
+
If you are adding a library, please add a `deploy.json` file similar to the ones in `lib/onyx` or `lib/layout`.
72
+
73
+
If no images or files are needed from the library, just include the following (the same as `lib/layout`):
74
+
75
+
```json
76
+
{
77
+
"packagejs": "./package.js",
78
+
"assets": [],
79
+
"libs": []
80
+
}
81
+
```
82
+
83
+
**NOTE:** In case you want full control of the minification process (target folders... etc), get familiar with the underlying Node.js script using:
84
+
85
+
$ node enyo/tools/deploy.js -h
51
86
52
-
If no images or files are needed from the library, just include blank (and executable) copies of the deploy scripts.
87
+
**NOTE:** For reference, the minification of an un-modified `bootplate` results in the following `deploy/` tree:
0 commit comments