Skip to content

Commit

Permalink
fix: fix multi-folder mix up during build
Browse files Browse the repository at this point in the history
  • Loading branch information
teclone committed Mar 4, 2019
1 parent 9bdb945 commit f1aa3ca
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/modules/Bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,27 @@ export default class Bundler {
const filePath = path.join(resolvedPath, file);

if (fs.statSync(filePath).isDirectory()) {
relDir = path.join(relDir, file);
this.getModules(
modules, filePath, mainModuleFileName, mainModuleName,
relDir, fileExtensions
path.join(relDir, file), fileExtensions
);
continue;
}
else {
const extname = path.extname(file);
const baseName = path.basename(file, extname);

const extname = path.extname(file);
const baseName = path.basename(file, extname);

const isAsset = !fileExtensions.includes(extname);
const isAsset = !fileExtensions.includes(extname);

const oldRelPath = path.join(relDir, file);
const relPath = path.join(relDir, baseName + '.js');
const oldRelPath = path.join(relDir, file);
const relPath = path.join(relDir, baseName + '.js');

modules.push({
relPath: isAsset ? oldRelPath : relPath,
name: oldRelPath === mainModuleFileName ? mainModuleName : baseName,
isAsset,
absPath: filePath
});
modules.push({
relPath: isAsset ? oldRelPath : relPath,
name: oldRelPath === mainModuleFileName ? mainModuleName : baseName,
isAsset,
absPath: filePath
});
}
}
return modules;
}
Expand Down Expand Up @@ -266,6 +265,9 @@ export default class Bundler {
//define the exportStore
exportStore = [];

console.log(modules);
console.log(externalModules);

if (!libConfig.disabled)
this.getExports(
exportStore,
Expand Down

0 comments on commit f1aa3ca

Please sign in to comment.