Skip to content

Commit

Permalink
Added babel to compile process. Don't minify bin
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogfalo committed Jul 13, 2017
1 parent 81ab9ba commit ab5a850
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
33 changes: 29 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ module.exports = function(grunt) {
}
},

babel: {
options: {
sourceMap: false,
plugins: [
'transform-es2015-literals',
'transform-es2015-classes'
]
},
bin: {
files: {
'bin/materialize.js': 'temp/js/materialize_concat.js'
}
},
dist: {
files: {
'dist/js/materialize.js': 'temp/js/materialize.js'
}
}
},

// Browser Sync integration
browserSync: {
bsFiles: ["bin/*.js", "bin/*.css", "!**/node_modules/**/*"],
Expand Down Expand Up @@ -162,7 +182,7 @@ module.exports = function(grunt) {
"js/tapTarget.js",
],
// the location of the resulting JS file
dest: 'dist/js/materialize.js'
dest: 'temp/js/materialize.js'
},
temp: {
// the files to concatenate
Expand Down Expand Up @@ -201,7 +221,7 @@ module.exports = function(grunt) {
"js/tapTarget.js",
],
// the location of the resulting JS file
dest: 'temp/js/materialize.js'
dest: 'temp/js/materialize_concat.js'
},
},

Expand Down Expand Up @@ -581,6 +601,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-browser-sync');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-babel');


// define the tasks
grunt.registerTask(
'release',[
Expand All @@ -593,6 +616,7 @@ module.exports = function(grunt) {
'concat:dist',
'uglify:dist',
'uglify:extras',
'babel:dist',
'usebanner:release',
'compress:main',
'compress:src',
Expand All @@ -601,12 +625,13 @@ module.exports = function(grunt) {
'replace:version',
'replace:readme',
'rename:rename_src',
'rename:rename_compiled'
'rename:rename_compiled',
'clean:temp'
]
);

grunt.registerTask('jade_compile', ['jade', 'notify:jade_compile']);
grunt.registerTask('js_compile', ['concat:temp', 'uglify:bin', 'notify:js_compile', 'clean:temp']);
grunt.registerTask('js_compile', ['concat:temp', 'babel:bin', 'notify:js_compile', 'clean:temp']);
grunt.registerTask('sass_compile', ['sass:gh', 'sass:bin', 'postcss:gh', 'postcss:bin', 'notify:sass_compile']);
grunt.registerTask('server', ['browserSync', 'notify:server']);
grunt.registerTask('lint', ['removelogging:source']);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"engine": "node >= 6",
"devDependencies": {
"autoprefixer": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"grunt": "^1.0.1",
"grunt-babel": "^6.0.0",
"grunt-banner": "^0.6.0",
"grunt-browser-sync": "^2.2.0",
"grunt-concurrent": "^2.3.1",
Expand Down

0 comments on commit ab5a850

Please sign in to comment.