Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ module.exports = function (grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);

let jsFiles = [
'src/module.js',
'.tmp/templates.js',
'src/image-loader-service.js',
'src/lightbox-service.js',
'src/lightbox-src-directive.js'
];
let cssFiles = [
'src/<%= library.name %>.css',
];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
library: grunt.file.readJSON('bower.json'),
Expand All @@ -17,19 +28,11 @@ module.exports = function (grunt) {
separator: ''
},
library: {
src: [
'src/module.js',
'.tmp/templates.js',
'src/image-loader-service.js',
'src/lightbox-service.js',
'src/lightbox-src-directive.js'
],
src: jsFiles,
dest: 'dist/<%= library.name %>.js'
},
css: {
src: [
'src/<%= library.name %>.css',
],
src: cssFiles,
dest: 'dist/<%= library.name %>.css'
}
},
Expand Down Expand Up @@ -91,6 +94,12 @@ module.exports = function (grunt) {
dest: 'api.md'
}
},
watch: {
dev: {
files: jsFiles.concat(cssFiles),
tasks: ['default']
}
}
});

grunt.registerTask('default', [
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ For now, the maximum video dimensions are fixed at 1280x720 (16:9).
grunt
```

* Watch source files and build automatically on changes:

```sh
grunt watch
```

* Generate docs:

```sh
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"grunt-contrib-htmlmin": "^0.5.0",
"grunt-contrib-jshint": "^0.11.3",
"grunt-contrib-uglify": "^0.9.2",
"grunt-contrib-watch": "^1.0.0",
"grunt-jsdoc-to-markdown": "^1.1.1",
"grunt-ng-annotate": "^1.0.1",
"jit-grunt": "^0.9.1",
Expand Down