Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Vulcanizing Material Design downloads | 1 # Vulcanizing Material Design downloads |
| 2 | 2 |
| 3 `vulcanize` is an npm module used to combine resources. In order to make the | 3 `vulcanize` is an npm module used to combine resources. In order to make the |
| 4 Material Design downloads page sufficiently fast, we run vulcanize on the source | 4 Material Design downloads page sufficiently fast, we run vulcanize on the source |
| 5 files to combine them and reduce blocking load/parse time. | 5 files to combine them and reduce blocking load/parse time. |
| 6 | 6 |
| 7 ## Required software | 7 ## Required software |
| 8 | 8 |
| 9 Vulcanization currently requires: | 9 Vulcanization currently requires: |
| 10 | 10 |
| 11 - node.js: >= v4.4.2 (can be found with `node --version`) | 11 - node.js: >= v4.4.2 (can be found with `node --version`) |
| 12 - npm: >= 1.3.10 (can be found with `npm --version`) | 12 - npm: >= 1.3.10 (can be found with `npm --version`) |
| 13 - vulcanize: 1.14.8 (can be found with `vulcanize --version`) | 13 - vulcanize: 1.14.8 (can be found with `vulcanize --version`) |
| 14 - crisper: 2.0.1 (can be found with `npm list -g crisper`) | 14 - crisper: 2.0.1 (can be found with `npm list -g crisper`) |
| 15 | 15 |
| 16 ## Installing required software | 16 ## Installing required software |
| 17 | 17 |
| 18 For instructions on installing node and npm, see | 18 For instructions on installing node and npm, see |
| 19 [here](https://docs.npmjs.com/getting-started/installing-node). | 19 [here](https://docs.npmjs.com/getting-started/installing-node). |
| 20 | 20 |
| 21 Once you've installed npm, you can get `crisper` and `vulcanize` via: | 21 We recommend telling npm where to store downloaded modules: |
| 22 | 22 |
| 23 ```bash | 23 ```bash |
| 24 $ sudo npm install -g crisper vulcanize | 24 $ npm config set -g prefix "$HOME/node_modules" |
|
Dan Beam
2016/04/05 15:39:04
i've never liked that we needed to use `sudo` for
| |
| 25 ``` | 25 ``` |
| 26 | 26 |
| 27 Then install `crisper` and `vulcanize` like this: | |
| 28 | |
| 29 ```bash | |
| 30 $ npm install -g crisper vulcanize | |
| 31 ``` | |
| 32 | |
| 33 Ultimately, all that is required to run this script is that `crisper` and | |
| 34 `vulcanize` are on your `$PATH`. | |
| 35 | |
| 27 ## Combining resources with vulcanize | 36 ## Combining resources with vulcanize |
| 28 | 37 |
| 29 To combine all the CSS/HTML/JS for the downloads page to make it production | 38 To combine all the CSS/HTML/JS for the downloads page to make it production |
| 30 fast, you can run the commands: | 39 fast, you can run the commands: |
| 31 | 40 |
| 32 ```bash | 41 ```bash |
| 33 $ chrome/browser/resources/md_downloads/vulcanize.py # from src/ | 42 $ chrome/browser/resources/md_downloads/vulcanize.py # from src/ |
| 34 ``` | 43 ``` |
| 35 | 44 |
| 36 This should overwrite the following files: | 45 This should overwrite the following files: |
| 37 | 46 |
| 38 - chrome/browser/resources/md_downloads/ | 47 - chrome/browser/resources/md_downloads/ |
| 39 - vulcanized.html (all <link rel=import> and stylesheets inlined) | 48 - vulcanized.html (all <link rel=import> and stylesheets inlined) |
| 40 - crisper.js (all JavaScript, extracted from vulcanized.html) | 49 - crisper.js (all JavaScript, extracted from vulcanized.html) |
| 41 | 50 |
| 42 ## Testing downloads without vulcanizing | 51 ## Testing downloads without vulcanizing |
| 43 | 52 |
| 44 Build with "use_vulcanize=0" in your GYP_DEFINES to build downloads without | 53 Build with "use_vulcanize=0" in your GYP_DEFINES to build downloads without |
| 45 vulcanizing. | 54 vulcanizing. |
| OLD | NEW |