Skip to content

Commit

Permalink
feat(fbt): add gulp watch-runtime to rebuild runtime fbt JS code on d…
Browse files Browse the repository at this point in the history
…emand

Reviewed By: jrwats

Differential Revision: D28675111

fbshipit-source-id: 066aec1e6f1f0e41e44d3043eaa723182a3e38ce
  • Loading branch information
kayhadrin authored and facebook-github-bot committed May 25, 2021
1 parent ecd2ae6 commit 893492c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 23 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const paths = {
lib: 'packages/fbt/lib',
license: 'LICENSE',
runtime: [
'runtime/**/*.js',
// Individually listing subfolders of `runtime` to allow watching through these symlinks
'runtime/nonfb/**/*.js',
'runtime/shared/**/*.js',
'runtime/shared_deps/**/*.js',
'!runtime/**/__tests__/*',
'!runtime/**/__mocks__/*',
],
Expand Down Expand Up @@ -231,3 +234,22 @@ gulp.task(
gulp.series('dist', 'dist:min'),
),
);

gulp.task('watch-runtime', () => {
gulp.watch(
[paths.license].concat(
paths.runtime,
paths.runtimeTests,
paths.runtimeMocks,
paths.typedModules,
paths.css,
),
{
cwd: __dirname,
ignoreInitial: false,
},
function watchRuntimeFbt(done) {
gulp.task('build-runtime')(done);
},
);
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"babel-plugin-fbt:test": "jest packages/babel-plugin-fbt",
"babel-plugin-fbt:watch": "yarn workspace babel-plugin-fbt watch",
"fbt:test": "jest packages/fbt",
"fbt:watch": "gulp watch-runtime",
"build-runtime": "gulp build-runtime",
"clean-build": "yarn install && yarn workspace demo-app clean-build",
"clean-build-offline": "yarn install --offline && yarn workspace demo-app clean-build",
Expand Down

0 comments on commit 893492c

Please sign in to comment.