Skip to content

Commit

Permalink
fix: only copy assets and typings if they are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
teclone committed May 6, 2019
1 parent 8b04b7a commit 3658ab9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/Bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ export default class Bundler {

for (const {isAsset, filePath, oldRelativePath, newRelativePath, isTypeDefinitionFile, name} of modules) {
src = filePath;
if (isAsset) {
if (isAsset && config.copyAssets) {
this.copyFile(filePath, path.join(config.outDir, oldRelativePath));
}
else if (isTypeDefinitionFile && config.copyTypings) {
this.copyFile(filePath, path.join(config.typingsDir, oldRelativePath));
}
else if (config.include.some(regexMatches) &&
else if (!isAsset && !isTypeDefinitionFile && config.include.some(regexMatches) &&
(config.exclude.length === 0 || !config.exclude.some(regexMatches))) {
exportStore.push({
input: filePath,
Expand Down Expand Up @@ -168,7 +168,7 @@ export default class Bundler {

const tdTester = /\.d\.ts$/i; //type definition tester

const isAsset = !fileExtensions.includes(extname) && ! tdTester.test(file);
const isAsset = !fileExtensions.includes(extname) && !tdTester.test(file);
const isTypeDefinitionFile = tdTester.test(file);

const oldRelativePath = path.join(currentRelativeDir, file);
Expand Down

0 comments on commit 3658ab9

Please sign in to comment.