diff --git a/package.json b/package.json index 087d5d49..41f9504c 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "devDependencies": { "babel-core": "^6.22.1", "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-import-redirect": "*", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-transform-es2015-modules-amd": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", diff --git a/utils/use_require.js b/utils/use_require.js index 3c249284..30d4cbd3 100755 --- a/utils/use_require.js +++ b/utils/use_require.js @@ -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}`);