Skip to content

Commit a6fa653

Browse files
committed
Apply newline to js files only.
1 parent b06ecc5 commit a6fa653

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function addAssetsToStream(paths, files) {
3939
name = paths.name,
4040
basePath = paths.basePath,
4141
filepaths = files[name].assets,
42+
type = paths.type,
4243
options = pluginOptions,
4344
gulpConcatOptions = {};
4445

@@ -74,7 +75,7 @@ function addAssetsToStream(paths, files) {
7475
});
7576

7677
// option for newLine in gulp-concat
77-
if (options.hasOwnProperty('newLine')) {
78+
if (options.hasOwnProperty('newLine') || type === 'js') {
7879
gulpConcatOptions.newLine = options.newLine;
7980
}
8081

@@ -121,7 +122,8 @@ function processAssets(file, basePath, data) {
121122
basePath: basePath,
122123
searchPath: pluginOptions.searchPath,
123124
cwd: file.cwd,
124-
transformPath: pluginOptions.transformPath
125+
transformPath: pluginOptions.transformPath,
126+
type: type
125127
}, files);
126128
}
127129
});

0 commit comments

Comments
 (0)