bundle - jspm preprocessing (injecting settings for the targeted environment) when bundling -


is there way preprocess .js files (i.e. inject environment specific settings) when bundling using buildstatic?

i don't know way pre-process js files during bundling can have different files/modules different environments , use js api swap development version production one:

gulp.task('jspm', function() {   var builder = new jspm.builder();    function production(builder) {     var systemnormalize = builder.loader.normalize;     builder.loader.normalize = function(name, parentname, parentaddress) {       if (name === 'ember') name = 'ember/ember.prod';       if (name === './app-config.dev') name = './app-config.prod';        return systemnormalize.call(this, name, parentname, parentaddress);     };   }    production(builder);    return builder.loadconfig('./config.js')     .then(function() {       return builder.buildstatic('app/main', 'dist/app.min.js', { sourcemaps: false, minify: false, mangle: false});     }); }); 

app-config.dev.js , app-config.prod.js modules use throughout app , provide environment-specific settings. in code, should import app-config.dev. read more workflow in blog post: how use systemjs hooks building production version of app


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -