Skip to content

Commit 9e7e407

Browse files
peiying16gideonthomas
authored andcommitted
issue 597 :grunt watch files for dist/bramble.js (#906)
Fix #597 * grunt watch files for dist/bramble.js * watch other files and run build-browser-dev task * change package.json scripts * update readme and package.json script
1 parent f5d72f3 commit 9e7e407

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

Gruntfile.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ module.exports = function (grunt) {
351351
test : {
352352
files: ['<%= meta.test %>', 'test/**/*'],
353353
tasks: ['eslint:test']
354+
},
355+
bramble : {
356+
files: ['src/bramble/**/*'],
357+
tasks: ['build-browser-dev']
354358
}
355359
},
356360
/* FIXME (jasonsanjose): how to handle extension tests */

README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,15 @@ consider adding the `--no-optional` flag to have npm skip installing `iltorb`, w
3939
and requires python, gyp and a working c++ build environment.
4040
See comment in https://github.com/mozilla/brackets/pull/588#issuecomment-280438175
4141

42-
Step 3: run the build
43-
44-
You can build Bramble by running the npm build task:
45-
46-
```
47-
$ npm run build
48-
```
49-
50-
Step 4: Run Bramble:
42+
Step 3: Run Bramble:
5143

5244
The easiest way to run Bramble is to simply use:
5345

5446
```
5547
$ npm start
5648
```
5749

58-
This will generate the strings needed for localization in your `src/nls` folder and allow you to access Bramble on `localhost:8000` (NOTE: you need npm version 5 for the cleanup step to run properly; if it doesn't, use `npm run unlocalize` to restore the files in `src/nls/**/*`). It will also build the Bramble iframe API in `dist/` if necessary. You can terminate the server with `Ctrl+C` which will also clean up the strings that were generated in your `src/nls` folder.
50+
This will generate the strings needed for localization in your `src/nls` folder and allow you to access Bramble on `localhost:8000` (NOTE: you need npm version 5 for the cleanup step to run properly; if it doesn't, use `npm run unlocalize` to restore the files in `src/nls/**/*`). It will also build the Bramble iframe API in `dist/` if necessary. You can terminate the server with `Ctrl+C` which will also clean up the strings that were generated in your `src/nls` folder. If any changes are made in the `src` directory, just refresh the page hosting Bramble in your browser to reflect those changes.
5951

6052
If you want to simply run the server without the localized strings, run:
6153

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"gunzip-maybe": "^1.3.1",
6060
"http-server": "mozilla/http-server#gzip",
6161
"mkdirp": "0.5.1",
62+
"npm-run-all": "^4.1.2",
6263
"nunjucks": "^2.4.3",
6364
"properties-parser": "0.3.1",
6465
"request": "^2.69.0",
@@ -72,13 +73,15 @@
7273
"localize-dist": "node scripts/properties2js dist",
7374
"unlocalize": "rimraf src/nls && git checkout -- src/nls",
7475
"postinstall": "grunt install",
75-
"build": "grunt build-browser",
76+
"build": "grunt build-browser-dev",
77+
"watch:api": "grunt watch:bramble",
7678
"preproduction": "grunt build-browser-compressed && npm run unlocalize",
7779
"production": "npm start -- --gzip",
7880
"test": "grunt test",
7981
"server": "http-server -p 8000 --cors",
8082
"prestart": "npm run localize && grunt build-browser-dev",
81-
"start": "npm run server || true",
83+
"start:server": "run-p server watch:api",
84+
"start": "npm run start:server || true",
8285
"poststart": "npm run unlocalize"
8386
},
8487
"license": "MIT"

0 commit comments

Comments
 (0)