Start a new topic
Answered

Kool... mscorlib.min.js

How did you guys make this minified version?


Is there now a compiler switch or something to produce a .min.js of our

duocode projects?


Please says its so!!!


Best Answer

You can use AjaxMin by Microsoft (you can NuGet it) it's very simple to use inside your .csproj:

https://www.nuget.org/packages/AjaxMin/

 

<UsingTask TaskName="AjaxMin" AssemblyFile="..\packages\AjaxMin.5.14.5506.26202\tools\net40\AjaxMinTask.dll" />
<Target Name="AfterBuild">
  <AjaxMin JsSourceFiles="$(OutDir)$(AssemblyName).js" JsSourceExtensionPattern=".js$" JsTargetExtension=".min.js" />
</Target>

 


and actually internally we use AjaxMin to generate mscorlb.min.js as well.


Answer

You can use AjaxMin by Microsoft (you can NuGet it) it's very simple to use inside your .csproj:

https://www.nuget.org/packages/AjaxMin/

 

<UsingTask TaskName="AjaxMin" AssemblyFile="..\packages\AjaxMin.5.14.5506.26202\tools\net40\AjaxMinTask.dll" />
<Target Name="AfterBuild">
  <AjaxMin JsSourceFiles="$(OutDir)$(AssemblyName).js" JsSourceExtensionPattern=".js$" JsTargetExtension=".min.js" />
</Target>

 


and actually internally we use AjaxMin to generate mscorlb.min.js as well.

Very Kool... Works like a CHAMP!!!

Question... the DuoCode.targets task: CopyFilesMarkedCopyLocal


Does not seem to be copying the .min.js version of my library packaged as a nuget.


Is there something i have to do to get the DuoCode.targets CopyFilesMarkedCopyLocal to inlcude

my minified version for my library project.


Example:


AjaxGateway.Duo.dll - (My DuCode Library Project Toolkit Assembly)

AjaxGateway.Duo.js  - (My DuoCode Library JavaScript File)

AjaxGateway.Duo.min.js - (My DuoCode Library Minified Using AjaxMin AfterBuild task)


I then package all these files up in a nuget package (install-package AjaxGateway.Duo)


What am i missing?

Currently we are not copying .min.js as a part of assembly reference.

But I think it's good idea to do so.

By now you can add such an extension to <AllowedReferenceRelatedFileExtensions> in DuoCode.targets, like: .min.js;

Also note: AllowedReferenceRelatedFileExtensions is not supported by XBuild.


We will add this support in the coming 1.2 version.

Thanks for reporting

Login or Signup to post a comment