pre-works for npm

This commit is contained in:
WEBXOSS 2016-10-16 21:30:11 +08:00
parent d3c0a40a3b
commit 7aa1c3f343
7 changed files with 68 additions and 15 deletions

4
.gitignore vendored
View file

@ -1,3 +1,5 @@
node_modules
*.sublime-workspace
*.sublime-project
*.sublime-project
dist

33
gulpfile.js Normal file
View file

@ -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'])

View file

@ -1,14 +0,0 @@
<html>
<head>
<meta charset="UTF-8">
<title>WIXOSS_Down</title>
<script src="./zip.js"></script>
<script src="./deflate.js"></script>
<script src="./inflate.js"></script>
<script src="./index.js"></script>
</head>
<body>
<textarea id="textarea"></textarea>
</body>
</html>

22
package.json Normal file
View file

@ -0,0 +1,22 @@
{
"name": "wixoss-fetch",
"version": "0.0.1",
"description": "Fetch WIXOSS card data from the official site.",
"main": "index.js",
"scripts": {
"build": "gulp build"
},
"keywords": [
"wixoss",
"tcg"
],
"author": "WEBXOSS <webxoss@gmail.com> (https://twitter.com/WEBXOSS)",
"license": "MIT",
"devDependencies": {
"browserify": "^13.0.0",
"del": "^2.2.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
}
}

10
static/index.html Normal file
View file

@ -0,0 +1,10 @@
<html>
<head>
<meta charset="UTF-8">
<title>WIXOSS_Fetch</title>
<script src="./index.js"></script>
</head>
<body>
</body>
</html>