I have a NuSpec file to create a NuGet package. I have some .js files that are minified and I don't want the original .js files in the NuGet package.
I have tried to use !
to not exclude minified files.
<files>
<file src="v1\**" target="v1" exclude="!v1\**\*.min.js;v1\**\*.js" />
</files>
This only doesn't work, it will delete the .js
and .min.js
files.
What kind of syntax can I use to achieve this?
I haven't found any solution to do this as I had imagined. It seems to me that it is simply not possible. There is also no mention of doing something similar in the nuspec documentation.
My solution finally was to split the files rows like this.
<files>
<!--Move all minified js files-->
<file src="v1\js\js1\*.min.js" target="v1\js\js1\" />
<file src="v1\js\js2\*.min.js" target="v1\js\js2\" />
<!--The rest of the files that are not js and exclude all source js files-->
<file src="v1\js\**" target="v1\js\" exclude="v1\js\**\*.js" />
</files>
I had to be more specific than I wanted to be because target
doesn't allow the use of *
.