I am using angular js (1.6),I have following task in grunt for minification angular modules
ngAnnotate: {
dist: {
files: [{
expand: true,
cwd: '.tmp/concat/scripts',
src: '*.js',
dest: '.tmp/concat/scripts'
}]
}
}
But above task not support ES2015 and ES2016 features How to add babel-plugin-angularjs-annotate in grunt task in iegrunt file
Firstly, install the plugin:
npm install babel-plugin-angularjs-annotate --save-dev
then there are two ways:
follow the readme, add the plugin into .babelrc file:
{ "plugins": ["angularjs-annotate"] }
in grunt.initConfig, set this plugin at babel part, like:
babel: { options: { sourceMap: true, presets: [@babel/preset-env], plugins: ['angularjs-annotate'] }, files: { expand: true, ... } }
any of them work.
my environment:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.