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

Commit

Permalink
fix(uglify): check for correct file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
jgw96 committed Mar 13, 2017
1 parent 1e7fb5b commit d17f2e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/uglifyjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d17f2e1

Please sign in to comment.