diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-11-11 13:33:47 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-11-11 13:33:47 +0100 |
commit | 6b208034015b9c4cc491be7c659d9888c7fb1fee (patch) | |
tree | 45436a6093f9f81d7a9b71c81c4a6e45cd779f07 | |
parent | 8cfa673d94c4cc7819fa817c3369cbb275ec6d24 (diff) | |
download | novnc-6b208034015b9c4cc491be7c659d9888c7fb1fee.tar.gz |
Clean up handling of untransformed files
This control flow is difficult enough as it is to follow. Move the
handling of the untransformed files to a separate block to make it
slightly easier to understand.
-rwxr-xr-x | utils/use_require.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/utils/use_require.js b/utils/use_require.js index d6b0df6..4cb6296 100755 --- a/utils/use_require.js +++ b/utils/use_require.js @@ -172,9 +172,17 @@ function make_lib_files(import_format, source_maps, with_app_dir, only_legacy) { return; // skip non-javascript files } + if (no_transform_files.has(filename)) { + return ensureDir(path.dirname(out_path)) + .then(() => { + console.log(`Writing ${out_path}`); + return copy(filename, out_path); + }); + } + return Promise.resolve() .then(() => { - if (only_legacy && !no_transform_files.has(filename)) { + if (only_legacy) { return; } return ensureDir(path.dirname(out_path)) @@ -185,10 +193,6 @@ function make_lib_files(import_format, source_maps, with_app_dir, only_legacy) { }) .then(() => ensureDir(path.dirname(legacy_path))) .then(() => { - if (no_transform_files.has(filename)) { - return; - } - const opts = babel_opts(); if (helper && helpers.optionsOverride) { helper.optionsOverride(opts); |