Skip to content

Commit 08952bd

Browse files
committed
🐛 Fix extension name not change
1 parent ef60b5e commit 08952bd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"dependencies": {
3636
"cson": "^4.1.0",
3737
"plugin-error": "^0.1.2",
38+
"replace-ext": "^1.0.0",
3839
"through2": "^2.0.3",
3940
"vinyl": "^2.1.0"
4041
},
@@ -47,7 +48,6 @@
4748
"del": "^3.0.0",
4849
"globby": "^7.1.1",
4950
"make-dir": "^1.1.0",
50-
"mocha": "*",
51-
"replace-ext": "^1.0.0"
51+
"mocha": "*"
5252
}
5353
}

src/main.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CSON = require 'cson'
22
PluginError = require 'plugin-error'
3+
replaceExt = require 'replace-ext'
34
through = require 'through2'
45

56
PLUGIN_NAME = 'gulp-json2cson'
@@ -14,7 +15,7 @@ module.exports = (indent = ' ') ->
1415
try
1516
json = JSON.parse file.contents.toString()
1617
file.contents = Buffer.from CSON.stringify json, null, indent
17-
file.extname = '.cson'
18+
file.path = replaceExt file.path, '.cson'
1819

1920
callback null, file
2021
catch error

0 commit comments

Comments
 (0)