-
npm i grunt-babel babel-preset-latest babel-plugin-transform-remove-strict-mode —-save-dev - move
src/appto_src/appand other base files likeindex.html. - update
.gitignoreto ignore the entiresrcdirectory (yeah!) - add babel grunt task config to go from
_src/apptosrc/app
babel: {
options: {
sourceMap: true,
presets: ['latest'],
plugins: ['transform-remove-strict-mode']
},
src: {
files: [{
expand: true,
cwd: '_src/app/',
src: ['**/*.js'],
dest: 'src/app/'
}]
}
}- add copy task to take care of all of the non-.js files
copy: {
dist: {
files: [{expand: true, cwd: 'src/', src: ['*.html'], dest: 'dist/'}]
},
src: {
expand: true,
cwd: '_src',
src: ['**/*.html', '**/*.css', '**/*.png', '**/*.jpg', 'secrets.json', 'app/package.json'],
dest: 'src'
}
}- may need to reconfigure stylus to point from
_src/apptosrc/app - repoint linter, watch, bump to
_srcdirectory - add
newer:babel&newer:copy:srctasks to watch - add new clean sub task to clean
src/app
clean: {
build: ['dist'],
deploy: ['deploy'],
src: ['src/app']
},- add babel/clean/copy tasks to build and default tasks
grunt.registerTask('default', [
'eslint',
'clean:src',
'babel',
'stylus:src',
'copy:src',
'connect',
'jasmine:main:build',
'watch'
]);
grunt.registerTask('build-prod', [
'clean:src',
'babel',
'stylus:src',
'copy:src',
'newer:imagemin:main',
'dojo:prod',
'uglify:prod',
'copy:dist',
'processhtml:main'
]);
- update eslintrc to be at the correct ecma version (no need if using
eslint-config-agrc)