Skip to content

Commit d7d7229

Browse files
author
Francois-Xavier KOWALSKI
committed
ENYO-1259: Bootplate doc & script update to use deploy.js
- removal of the `tools/` folder (now embedded into `$enyo/tools`). - `tools/README.md` is now `deploy.md` & is updated to use `deploy.js` - this commit demands that this Enyo branch is merged first into `enyojs/enyo` https://github.com/enyojs/enyo/tree/ENYO-1259 Enyo-DCO-1.0-Signed-off-by: Francois-Xavier KOWALSKI <[email protected]>
1 parent 4d56b2c commit d7d7229

File tree

7 files changed

+53
-303
lines changed

7 files changed

+53
-303
lines changed

deploy.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Minification and Deployment
2+
## Understanding and Using Minification
3+
4+
Enyo comes with a minification tool based on UglifyJS, run by Node.js.
5+
6+
This tool can be used to compress the framework, other libraries, and applications, and will keep load order intact as well as correct url paths in css.
7+
8+
### Why compress?
9+
10+
Compressing enyo apps greatly reduces load times of applications, as well as reducing overall code size.
11+
12+
This way, you can be very verbose in the documentation of your source code, without that impacting the performance of your application in production.
13+
14+
### What is compressed
15+
16+
For enyo, the libraries, and your code: **external assets such as images will not be copied or moved**.
17+
18+
Instead, the CSS url paths are fixed up to reference the new path from the build location.
19+
20+
### How to compress
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`.
23+
24+
$ node enyo/tools/deploy.js -h
25+
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.
27+
28+
Any libraries referenced in your `package.js` manifest will be built into your app's built code.
29+
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.
31+
32+
### What comes out?
33+
34+
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.
35+
36+
In it will be 4 files:
37+
- enyo.css
38+
- enyo.js
39+
- app.css
40+
- app.js
41+
42+
These files will be loaded in the given order by `index.html`.
43+
44+
The output of the `deploy` scripts will minify your appliaction, and copy the necessary files into `deploy/<appname>/`.
45+
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.
47+
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.
49+
50+
If you are adding a library, please add a `deploy.sh` file and `deploy.bat` file similar to the ones in `lib/onyx`.
51+
52+
If no images or files are needed from the library, just include blank (and executable) copies of the deploy scripts.

tools/package.js renamed to package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
== DO NOT EDIT THIS FILE! ==
33
This is necessary to keep paths correct for the minification process
44
*/
5-
enyo.depends("../source");
5+
enyo.depends("source");

tools/README.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

tools/deploy.bat

Lines changed: 0 additions & 130 deletions
This file was deleted.

tools/deploy.sh

Lines changed: 0 additions & 92 deletions
This file was deleted.

tools/minify.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

tools/minify.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)