Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit d17f2e1

Browse files
committed
fix(uglify): check for correct file extension
1 parent 1e7fb5b commit d17f2e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/transpile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function transpileBundleImpl(context: BuildContext, target: ts.ScriptTarget) {
312312
try {
313313
const files = readdirSync(context.buildDir);
314314
files.forEach((file) => {
315-
if (path.extname(file) === 'js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) {
315+
if (path.extname(file) === '.js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) {
316316
const bundlePath = path.join(context.buildDir, file);
317317
const bundleContent = readFileSync(bundlePath).toString();
318318
const tsConfig = getTsConfig(context);

src/uglifyjs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function uglifyjsWorker(context: BuildContext, configFile: string): Promi
3434
const files = readdirSync(context.buildDir);
3535

3636
files.forEach((file) => {
37-
if (extname(file) === 'js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) {
37+
if (extname(file) === '.js' && file.indexOf('polyfills') === -1 && file.indexOf('sw-toolbox') === -1) {
3838
const uglifyJsConfig: UglifyJsConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile);
3939
uglifyJsConfig.sourceFile = join(context.buildDir, file);
4040
uglifyJsConfig.inSourceMap = join(context.buildDir, uglifyJsConfig.inSourceMap);

0 commit comments

Comments
 (0)