Skip to content

Commit

Permalink
Fix for babel trying to find concat file before it's created
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogfalo committed Jul 25, 2017
1 parent c0233b1 commit fc44c86
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = function(grunt) {

var concatFile = 'temp/js/materialize_concat.js.map';

// configure the tasks
grunt.initConfig({
var config = {
// Copy
copy: {
dist: { cwd: 'fonts', src: [ '**' ], dest: 'dist/fonts', expand: true },
Expand Down Expand Up @@ -114,8 +116,7 @@ module.exports = function(grunt) {
},
bin: {
options: {
sourceMap: true,
inputSourceMap: grunt.file.readJSON('temp/js/materialize_concat.js.map')
sourceMap: true
},
files: {
'bin/materialize.js': 'temp/js/materialize_concat.js'
Expand Down Expand Up @@ -590,7 +591,9 @@ module.exports = function(grunt) {
}
}
},
});
};

grunt.initConfig(config);

// load the tasks
// grunt.loadNpmTasks('grunt-gitinfo');
Expand Down Expand Up @@ -640,8 +643,12 @@ module.exports = function(grunt) {
]
);

grunt.task.registerTask("configureBabel", "configures babel options", function() {
config.babel.bin.options.inputSourceMap = grunt.file.readJSON(concatFile);
});

grunt.registerTask('jade_compile', ['jade', 'notify:jade_compile']);
grunt.registerTask('js_compile', ['concat:temp', 'babel:bin', 'notify:js_compile', 'clean:temp']);
grunt.registerTask('js_compile', ['concat:temp', 'configureBabel', '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

0 comments on commit fc44c86

Please sign in to comment.