Search code examples
durandalhottowel

How to customize the Durandal optimizer?


how to customize the durandal optimizer that it works on file named setup instead of main.js, also how to optimize more than one boot file in case of more than one SPA in a web app?


Solution

  • As of right now you cannot tell the optimizer to use setup.js instead of main.js. There is no hook into the options for that but the project is open source! hurray! And you can pull down the code and change the configuration and build it for your own custom optimizer.

    In the Optimizer project for durandal you can change where it finds the main path here.

    If I understand your question correctly I think you might be in luck for optimizing more than one boot file for multiple spas. The optimizer does have a configuration called source used like so:

    optimizer.exe --source c:\project\spa1
    optimizer.exe --source c:\project\spa2
    

    Where spa1 and spa2 are paths to the folder which contains your application source. Which is the root folder for each application where the setup.js files are located.