Skip to content

Commit

Permalink
WORKING: modularize grunt webpack task
Browse files Browse the repository at this point in the history
  • Loading branch information
1ambda committed Dec 28, 2016
1 parent b8acc28 commit 94bedef
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions zeppelin-web/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,42 +421,12 @@ module.exports = function(grunt) {

// Copies remaining files to places other tasks can use
copy: {
dev: {
'webpack-vendor': {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'**/*.css',
'assets/styles/**/*',
'assets/images/**/*',
'WEB-INF/*'
]
}, {
// copy fonts
expand: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: ['fonts/**/*.{eot,svg,ttf,woff}']
}, {
expand: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: ['app/**/*.html', 'components/**/*.html']
}, {
expand: true,
cwd: 'bower_components/datatables/media/images',
src: '{,*/}*.{png,jpg,jpeg,gif}',
dest: '.tmp/images'
}, {
expand: true,
cwd: '.tmp/images',
dest: '.tmp/images',
src: ['generated/*']
}, {
expand: true,
cwd: 'bower_components/bootstrap/dist',
Expand Down Expand Up @@ -485,6 +455,39 @@ module.exports = function(grunt) {
dest: '.tmp'
}]
},
'webpack-source': {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: [
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'**/*.css',
'assets/styles/**/*',
'assets/images/**/*',
'WEB-INF/*'
]
}, {
// copy fonts
expand: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: ['fonts/**/*.{eot,svg,ttf,woff}']
}, {
expand: true,
cwd: '<%= yeoman.app %>',
dest: '.tmp',
src: ['app/**/*.html', 'components/**/*.html']
},{
expand: true,
cwd: '.tmp/images',
dest: '.tmp/images',
src: ['generated/*']
}]
},
dist: {
files: [{
expand: true,
Expand Down Expand Up @@ -563,11 +566,13 @@ module.exports = function(grunt) {

// Run some tasks in parallel to speed up the build process
concurrent: {
server: [
'copy:dev'
webpack: [
'copy:webpack-vendor',
'copy:webpack-source',
],
test: [
'copy:dev',
'copy:webpack-vendor',
'copy:webpack-source',
],
dist: [
'copy:styles',
Expand All @@ -591,16 +596,11 @@ module.exports = function(grunt) {

grunt.task.run([
'clean:server',
'copy:dev',
'concurrent:webpack',
'postcss',
]);
});

grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function(target) {
grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
grunt.task.run(['serve:' + target]);
});

grunt.registerTask('test', [
'clean:server',
'babel',
Expand Down

0 comments on commit 94bedef

Please sign in to comment.