diff --git a/.gitignore b/.gitignore index eded32c..9990bda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules *.sublime-workspace -*.sublime-project \ No newline at end of file +*.sublime-project + +dist \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..73d7493 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,33 @@ +'use strict' + +let gulp = require('gulp') +let browserify = require('browserify') +let source = require('vinyl-source-stream') +let buffer = require('vinyl-buffer') +let sourcemaps = require('gulp-sourcemaps') +let del = require('del') + +let path = { + dest: './dest/', +} + +gulp.task('clean', function () { + return del([path.dest]) +}) + +gulp.task('static', ['clean'], function () { + return gulp.src('./static/*') + .pipe(gulp.dest(path.dest)) +}) + +gulp.task('script', ['clean'], function () { + return browserify('./src/index.js', { debug: true }) + .bundle() + .pipe(source('matcg_fetch.js')) + .pipe(buffer()) + .pipe(sourcemaps.init({ loadMaps: true })) + .pipe(sourcemaps.write(path.dest)) + .pipe(gulp.dest(path.dest)) +}) + +gulp.task('build', ['clean', 'static', 'script']) diff --git a/index.html b/index.html deleted file mode 100644 index 26221b4..0000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -
- -