Closed therazor closed 10 years ago
We look at the file extension to determine what we need to convert from.
We look at the file extension to determine what we need to convert from.
@erethnor since you used XYZ
in your example, was there a real use case that you had a problem with, or was this just experimental? If it's a real use case, can you share more information on what kind of file and extension the plugin should be recognizing?
@jonschlinkert I have an actual use case: .xmp
files.
Apart from the extension, they are just XML.
I could suggest 2 solutions:
or
I'd prefer solution 1 personally, as it'd be the least likely to break anything. What do you think?
I too found this. I would like to convert ".fnt" files which are actually xml files. Thanks.
thanks @hariadi!
I just gave this a go and it seems to be working but if is only converting the first file. All the other files are renamed but not actually converted:
convert: {
options: {
explicitArray: false,
type: 'xml'
},
xml2json: {
files: [
{
expand: true,
cwd: '<%= deployPath %>/assets/',
src: [ '**/*.xml', '**/*.fnt', '**/*.pex' ],
dest: '<%= deployPath %>/assets/',
ext: '.json'
}
]
},
},
I currently have three ".fnt" files. All are duplicated and named ".json" but only the first file has actually been converted into json.
Am I doing something wrong?
Example:
Changing the extension of the file works as intended.