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);