Adjust import of vendor/ modules in NPM package

We move the files in core/ up one directory level so we need to adjust
the imports from vendor libraries.
This commit is contained in:
Pierre Ossman
2017-07-04 10:10:36 +02:00
parent d5c5b4aab7
commit 1524df89ad
2 changed files with 8 additions and 0 deletions

View File

@@ -131,6 +131,13 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) {
if (helper && helpers.optionsOverride) {
helper.optionsOverride(opts);
}
// Adjust for the fact that we move the core files relative
// to the vendor directory
if (!in_path) {
opts.plugins.push(["import-redirect",
{"root": out_path_base,
"redirect": { "vendor/(.+)": "./vendor/$1"}}]);
}
babel.transformFile(filename, opts, (err, res) => {
console.log(`Writing ${out_path}`);