Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
serve is working except for custom flattening. meh
Browse files Browse the repository at this point in the history
  • Loading branch information
bmuenzenmeyer committed Jun 16, 2016
1 parent 9f7353c commit 64abb92
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function (grunt) {
pl = require('patternlab-node')(config);

function paths() {
return require('./patternlab-config.json').paths;
return config.paths;
}

function getConfiguredCleanOption() {
Expand Down Expand Up @@ -70,17 +70,14 @@ module.exports = function (grunt) {
copy: {
main: {
files: [
{ expand: true, cwd: path.resolve(paths().source.js), src: '*.js', dest: path.resolve(paths().public.js) },
{ expand: true, cwd: path.resolve(paths().source.js), src: '**/*.js', dest: path.resolve(paths().public.js) },
{ expand: true, cwd: path.resolve(paths().source.css), src: '*.css', dest: path.resolve(paths().public.css) },
{ expand: true, cwd: path.resolve(paths().source.images), src: ['**/*.png', '**/*.jpg', '**/*.gif', '**/*.jpeg'], dest: path.resolve(paths().public.images) },
{ expand: true, cwd: path.resolve(paths().source.images), src: '*', dest: path.resolve(paths().public.images) },
{ expand: true, cwd: path.resolve(paths().source.fonts), src: '*', dest: path.resolve(paths().public.fonts) },
{ expand: true, cwd: path.resolve(paths().source.data), src: 'annotations.js', dest: path.resolve(paths().public.data) },
{ expand: true, cwd: path.resolve(paths().source.root), src: 'favicon.ico', dest: path.resolve(paths().public.root) }
]
},
styleguide: {
files: [
{ expand: true, cwd: path.resolve(paths().source.styleguide), src: ['*.*', '**/*.*'], dest: path.resolve(paths().public.styleguide) }
{ expand: true, cwd: path.resolve(paths().source.root), src: 'favicon.ico', dest: path.resolve(paths().public.root) },
{ expand: true, cwd: path.resolve(paths().source.styleguide), src: ['*', '**'], dest: path.resolve(paths().public.root) },
// slightly inefficient to do this again - I am not a grunt glob master. someone fix
{ expand: true, flatten: true, cwd: path.resolve(paths().source.styleguide, 'styleguide', 'css', 'custom'), src: '*.css)', dest: path.resolve(paths().public.styleguide, 'css') }
]
}
},
Expand Down Expand Up @@ -150,13 +147,11 @@ module.exports = function (grunt) {
});

/******************************************************
* COMPOUND AND ALIASED TASKS
* COMPOUND TASKS
******************************************************/

grunt.registerTask('default', ['patternlab', 'copy:main', 'copy:styleguide']);
grunt.registerTask('pl-serve', ['patternlab', 'copy:main', 'copy:styleguide', 'browserSync', 'watch:all']);
grunt.registerTask('default', ['patternlab', 'copy:main']);
grunt.registerTask('patternlab:watch', ['patternlab', 'copy:main', 'watch:all']);
grunt.registerTask('patternlab:serve', ['patternlab', 'copy:main', 'browserSync', 'watch:all']);

//Aliases
grunt.registerTask('pl-help', ['patternlab:help']);
grunt.registerTask('pl-patterns', ['patternlab:patternsonly']);
};

0 comments on commit 64abb92

Please sign in to comment.