Skip to content

Commit

Permalink
πŸ› Improve DX for local environment (ampproject#2186)
Browse files Browse the repository at this point in the history
* πŸ“ Make it clearer where to access local site

* πŸ› Export sass, template and icon tasks
  • Loading branch information
matthiasrohmer authored and pbakaus committed May 24, 2019
1 parent 841ea14 commit a611af2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ You can then start developing in your local environment with the command below.
$ gulp develop
```
This command prints a lot to the shell and will most probably end on `Server ready. Press ctrl-c to quit.`. This means everything went fine so far but other than stated in the logs the site is then available at [http://localhost:8080/](http://localhost:8080/). The service running on 8081 is only Grow rendering the pages.
### Maintenance
#### Documents
Expand Down
3 changes: 3 additions & 0 deletions gulpfile.js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ function persistBuildInfo(done) {
}

exports.clean = clean;
exports.sass = sass;
exports.icons = icons;
exports.templates = templates;
exports.importAll = importAll;
exports.buildPlayground = buildPlayground;
exports.buildBoilerplate = buildBoilerplate;
Expand Down
20 changes: 9 additions & 11 deletions gulpfile.js/develop.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,20 @@ function bootstrap(done) {
gulp.parallel(build.buildBoilerplate, build.buildPlayground, build.importAll)(done);
}

function develop(done) {
gulp.series(gulp.parallel(build.buildFrontend, build.collectStatics), _run)(done);
function develop() {
gulp.series(gulp.parallel(build.buildFrontend, build.collectStatics), run)();
}

function _run() {
signale.info('Watching icons, templates and styles ...');

samplesBuilder.build(true);
gulp.watch(`${project.paths.ICONS}/**/*`, build.icons);
gulp.watch(`${project.paths.TEMPLATES}/**/*`, build.templates);
gulp.watch(`${project.paths.SCSS}/**/*`, build.sass);

function run() {
config.configureGrow();

grow(`run --port ${config.hosts.pages.port}`);

signale.info('Watching icons, templates, styles and samples ...');
samplesBuilder.build(true);
gulp.watch(`${project.paths.ICONS}/**/*.svg`, build.icons);
gulp.watch(`${project.paths.TEMPLATES}/**/*.j2`, build.templates);
gulp.watch(`${project.paths.SCSS}/**/*.scss`, build.sass);

new Platform().start();
}

Expand Down

0 comments on commit a611af2

Please sign in to comment.