mardi 16 août 2016

Keep copyright/license comments from being removed when minified in Ember

I have license and copyright notices using JSDoc style comments in my Ember-Cli project. I have set minifyJS and minifyCSS to true under test and production builds, but it is removing my copyright notices.

Under UglifyJS2 documentation (http://ift.tt/MWUf1D), which is built in with Ember, it states that it preserves JSDoc style comments with the @preserve tag, similar to Google Closure, but it is removing them. How do I protect these comments from being minified?

Build Settings;

//ember-cli-build.js
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var isDevelopment = EmberApp.env() === 'development';
module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    // Add options here
    minifyCSS: {
      enabled: !isDevelopment
    },
    minifyJS: {
      enabled: !isDevelopment
    },
    sourcemaps: {
      enabled: isDevelopment
    }
  });
  return app.toTree();
};

Component with Copyright/License:

// app/components/sample.js
/*
* @preserve
* @file This is a sample component
* @copyright Company, Inc.
* @author FirstName LastName
*/




Aucun commentaire:

Enregistrer un commentaire