Browse Source

Added scripts to package.json. Fixed watching for css changes too.

css_transitions^2
jos 10 years ago
parent
commit
951dd61b3a
6 changed files with 22 additions and 9 deletions
  1. +10
    -0
      README.md
  2. +3
    -3
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +2
    -2
      dist/vis.min.js
  5. +3
    -2
      gulpfile.js
  6. +3
    -1
      package.json

+ 10
- 0
README.md View File

@ -135,6 +135,16 @@ Then, the project can be build running:
npm run build
To automatically rebuild on changes in the source files, once can use
npm run watch
This will both build and minify the library on changes. Minifying is relatively
slow, so when only the non-minified library is needed, one can use the
`watch-dev` script instead:
npm run watch-dev
## Test

+ 3
- 3
dist/vis.js View File

@ -8171,8 +8171,8 @@ return /******/ (function(modules) { // webpackBootstrap
*/
function getPointer (touch, element) {
return {
x: touch.pageX - vis.util.getAbsoluteLeft(element),
y: touch.pageY - vis.util.getAbsoluteTop(element)
x: touch.pageX - util.getAbsoluteLeft(element),
y: touch.pageY - util.getAbsoluteTop(element)
};
}
@ -11475,7 +11475,7 @@ return /******/ (function(modules) { // webpackBootstrap
}
else {
// add item
var xAbs = vis.util.getAbsoluteLeft(this.dom.frame);
var xAbs = util.getAbsoluteLeft(this.dom.frame);
var x = event.gesture.center.pageX - xAbs;
var start = this.body.util.toTime(x);
var newItem = {

+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 2
- 2
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 3
- 2
gulpfile.js View File

@ -34,6 +34,7 @@ var bannerPlugin = new webpack.BannerPlugin(createBanner(), {
raw: true
});
// TODO: the moment.js language files should be excluded by default (they are quite big)
var webpackConfig = {
entry: ENTRY,
output: {
@ -125,13 +126,13 @@ gulp.task('bundle', ['bundle-js', 'bundle-css', 'copy-img']);
// The watch task (to automatically rebuild when the source code changes)
gulp.task('watch', ['bundle', 'minify'], function () {
gulp.watch(['index.js', 'lib/**/*.js'], ['bundle', 'minify']);
gulp.watch(['index.js', 'lib/**/*'], ['bundle', 'minify']);
});
// The watch task (to automatically rebuild when the source code changes)
// this watch only rebuilds vis.js, not vis.min.js
gulp.task('watch-dev', ['bundle'], function () {
gulp.watch(['index.js', 'lib/**/*.js'], ['bundle']);
gulp.watch(['index.js', 'lib/**/*'], ['bundle']);
});
// The default task (called when you run `gulp`)

+ 3
- 1
package.json View File

@ -23,7 +23,9 @@
"main": "./index",
"scripts": {
"test": "mocha",
"build": "build"
"build": "gulp",
"watch": "gulp watch",
"watch-dev": "gulp watch-dev"
},
"dependencies": {
"emitter-component": "^1.1.1",

Loading…
Cancel
Save