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:
parent
d5c5b4aab7
commit
1524df89ad
|
@ -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",
|
||||
|
|
|
@ -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}`);
|
||||
|
|
Loading…
Reference in New Issue