From d17f2e1ebb0609d4ea0654824e1cb9108ef1205f Mon Sep 17 00:00:00 2001 From: jgw96 Date: Mon, 13 Mar 2017 17:21:09 -0500 Subject: [PATCH] fix(uglify): check for correct file extension --- src/transpile.ts | 2 +- src/uglifyjs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transpile.ts b/src/transpile.ts index 9ab2c898..44ad25f9 100644 --- a/src/transpile.ts +++ b/src/transpile.ts @@ -312,7 +312,7 @@ function transpileBundleImpl(context: BuildContext, target: ts.ScriptTarget) { try { const files = readdirSync(context.buildDir); files.forEach((file) => { - if (path.extname(file) === 'js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) { + if (path.extname(file) === '.js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) { const bundlePath = path.join(context.buildDir, file); const bundleContent = readFileSync(bundlePath).toString(); const tsConfig = getTsConfig(context); diff --git a/src/uglifyjs.ts b/src/uglifyjs.ts index 64f1e644..2b0cc906 100644 --- a/src/uglifyjs.ts +++ b/src/uglifyjs.ts @@ -34,7 +34,7 @@ export function uglifyjsWorker(context: BuildContext, configFile: string): Promi const files = readdirSync(context.buildDir); files.forEach((file) => { - if (extname(file) === 'js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) { + if (extname(file) === '.js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) { const uglifyJsConfig: UglifyJsConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile); uglifyJsConfig.sourceFile = join(context.buildDir, file); uglifyJsConfig.inSourceMap = join(context.buildDir, uglifyJsConfig.inSourceMap);