1

I am optimizing my Durandal build with the following optimizer settings:

options: {
    name: '../lib/require/almond-custom',
    baseUrl: requireConfig.baseUrl,
    mainPath: 'app/main',
    paths: mixIn({ }, requireConfig.paths, { 'almond': 'lib/require/almond-custom.js' }),
    optimize: 'none',
    out: 'build/app/main.js',
    preserveLicenseComments: false
}

My issue is that I have a config.js in my requireConfig.paths, which I would like to exlude from the optimization and use as a non optimized version. The reason for that is because I would like to be able to alter the config file on a build without digging in to an optimized file.

I tried exclude and empty:, but that will only exclude the config from the optimized js file. How would I include it as a "remote" file?

config.js:

define(['foo', 'bar'], function(){
    return {
        // some variables that are used in my other modules here
    };
});
Johan
  • 53
  • 4
  • I think you would want to include those scripts in a separate layer and disable certain optimizations only for that layer. – zero298 Sep 27 '16 at 17:58
  • @zero298 Could you give me an example? – Johan Sep 27 '16 at 21:30
  • Is your `requireConfig` variable created from the contents of your `config.js`? And can you show your `config.js` in your question? – Louis Sep 29 '16 at 10:26
  • @Louis No, they have nothing to do with each other. `config.js` is a bit misleading name. It's just a module that I use for settings throughout my app. I would like to be able to modify these settings by altering the `config.js` in an optimized version of my project. – Johan Sep 29 '16 at 20:09

0 Answers0