0
与browserify,我试图只需要在开发时模块。出于某种原因,它也一直被纳入生产。有条件需要browserify
NPM脚本:
"start": "export NODE_ENV=development&& grunt watch & grunt serve",
"prod": "export NODE_ENV=production&& grunt prod"
组件需要:
const isProduction = process.env.NODE_ENV === 'production';
require('animation.gsap');
if (!isProduction) {
require('debug.addIndicators');
}