Comparing version 1.0.3 to 1.0.4
@@ -6,3 +6,3 @@ #!/usr/bin/env node | ||
const path = require('path'); | ||
const server = require('../src/function/server.js'); | ||
//const server = require('../src/function/server.js'); | ||
const shelljs = require('shelljs'); | ||
@@ -37,6 +37,6 @@ const deal = require('../src/function/deal.js'); | ||
} | ||
// if (!fs.existsSync(REAL_GULP_CONFIG)) { | ||
// fs.copySync(GULP_CONFIG, REAL_GULP_CONFIG); | ||
// msg.info('gulp配置文件创建成功, 请根据项目情况进行配置'); | ||
// } | ||
if (!fs.existsSync(REAL_GULP_CONFIG)) { | ||
fs.copySync(GULP_CONFIG, REAL_GULP_CONFIG); | ||
msg.info('gulp配置文件创建成功, 请根据项目情况进行配置'); | ||
} | ||
if (!fs.existsSync(REAL_WEBPACK_CONFIG)) { | ||
@@ -43,0 +43,0 @@ fs.copySync(WEBPACK_CONFIG, REAL_WEBPACK_CONFIG); |
{ | ||
"name": "riot-zero", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -28,4 +28,7 @@ "main": "index.js", | ||
"gulp-minify-html": "^1.0.6", | ||
"gulp-nodemon": "^2.2.1", | ||
"gulp-rev": "^7.1.2", | ||
"gulp-riot": "^1.1.1", | ||
"gulp-run": "^1.7.1", | ||
"gulp-shell": "^0.6.3", | ||
"gulp-strip-debug": "^1.1.0", | ||
@@ -32,0 +35,0 @@ "gulp-uglify": "^3.0.0", |
@@ -62,9 +62,10 @@ const gulp = require('gulp'); | ||
*/ | ||
// gulp.task('dev-serve',function(){ | ||
// nodemon({ | ||
// script: 'server.js', | ||
// ext: 'js', | ||
// watch: ['server.js'] | ||
// }); | ||
// }) | ||
gulp.task('dev-serve',function(){ | ||
nodemon({ | ||
script: 'server.js', | ||
ext: 'js', | ||
watch: ['server.js'], | ||
env: { 'PORT': process.argv[process.argv.length-1] } | ||
}); | ||
}) | ||
@@ -74,7 +75,7 @@ /* | ||
*/ | ||
gulp.task('dev',['riot','webpack','less'],function(){ | ||
gulp.watch(['src/tag/**/*.tag'], ['riot','webpack']); | ||
gulp.watch(['src/js/*.js', '!src/js/tags.js'], ['webpack']); | ||
gulp.watch('src/css/**/*.less', ['less']); | ||
}); | ||
gulp.task('dev',['riot','webpack','less','dev-serve'],function(){ | ||
gulp.watch(['src/tag/**/*.tag','src/js/tags-dep.js'], ['riot','webpack']); | ||
gulp.watch(['src/js/**/*.js', '!src/js/tags.js','!src/js/tags-dep.js'], ['webpack']); | ||
gulp.watch('src/css/**/*.less', ['less']); | ||
}); | ||
/* | ||
@@ -81,0 +82,0 @@ * 删除dist目录 |
@@ -22,2 +22,3 @@ { | ||
"autoprefixer": "^6.6.1", | ||
"axios": "^0.16.2", | ||
"babel-core": "^6.21.0", | ||
@@ -41,2 +42,3 @@ "babel-loader": "^6.2.10", | ||
"riot-route": "^3.1.1", | ||
"riot-seed-flux": "^0.2.3", | ||
"riot-seed-router": "^0.2.0", | ||
@@ -43,0 +45,0 @@ "webpack": "^1.14.0", |
const conf = { | ||
const bird = require('gulp-bird'); | ||
const serverConf = { | ||
server:{ | ||
port:'8007', | ||
port:process.env.PORT, | ||
basePath:'./src' | ||
@@ -9,9 +10,8 @@ }, | ||
targetServer:{ | ||
port: '80', | ||
host: 'tieba.baidu.com', | ||
port: '8276', | ||
host: 'cp01-hiserver-sandbox1-tc.cp01.baidu.com', | ||
replaceHeaders: true, | ||
header:{ | ||
cookie:'BDUSS=kM4am82QXpyazRVdEIzMUxKWGJKSERCeXR-N0p-ck5ydVlZRU55MnFrRmROVzlaSUFBQUFBJCQAAAAAAAAAAAEAAACLfV6bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF2oR1ldqEdZW', | ||
Host:'tieba.baidu.com', | ||
Referer:'http://tieba.baidu.com/' | ||
cookie:'xplatform_ge=4ffcc236a075c3e1f5068f172f654bbe9a1f23adc1563138c432b72b0d06261a153cc6f5a40' | ||
} | ||
@@ -22,3 +22,11 @@ }, | ||
}; | ||
module.exports = conf; | ||
var server = {}; | ||
var TranspondRules = {}; | ||
server[serverConf.server.port] = { | ||
basePath : serverConf.server.basePath, | ||
} | ||
TranspondRules[serverConf.server.port] ={ | ||
targetServer: serverConf.transpondRules.targetServer, | ||
} | ||
TranspondRules['ajaxOnly'] = serverConf.transpondRules.ajaxOnly | ||
bird.start(server, TranspondRules); |
@@ -1,89 +0,9 @@ | ||
const gulp = require('gulp'); | ||
const riot = require('gulp-riot'); | ||
const concat = require('gulp-concat'); | ||
const webpack = require('webpack-stream'); | ||
const less = require('gulp-less'); | ||
const autoprefix = require('gulp-autoprefixer'); | ||
//const postcss = require('gulp-postcss'); | ||
//const del = require('del'); | ||
//const nodemon = require('gulp-nodemon'); | ||
//const spritesmith = require('gulp.spritesmith'); | ||
const minifyCss = require('gulp-minify-css'); | ||
const minifyHtml = require('gulp-minify-html'); | ||
const stripDebug = require('gulp-strip-debug'); | ||
const uglify = require('gulp-uglify'); | ||
const rev = require('gulp-rev'); | ||
const usemin = require('gulp-usemin'); | ||
const server = require('./server.js'); | ||
const currentPath = process.cwd(); | ||
const path = require('path'); | ||
const indexPath = path.join(currentPath,'./src/index.html'); | ||
const shell = require('shelljs'); | ||
module.exports = function(type,port){ | ||
if(type ==='dev'){ | ||
var tagsPath = path.join(currentPath,'./src/tag/**'); | ||
var tagsDep = path.join(currentPath,'./src/js/tags-dep.js'); | ||
var tagjs = path.join(currentPath,'./src/js'); | ||
function handtag(){ | ||
gulp.src([tagsDep,tagsPath]) | ||
.pipe(riot()) | ||
.pipe(concat('tags.js')) | ||
.pipe(gulp.dest(tagjs)); | ||
} | ||
function handless(){ | ||
gulp.src(lessPath) | ||
.pipe(less()) | ||
.pipe(concat('bundle.css')) | ||
.pipe(autoprefix()) | ||
.pipe(gulp.dest(bundlecssPath)); | ||
} | ||
function handwebpack(){ | ||
gulp.src(bootPath) | ||
.pipe(webpack(require(webpackPath))) | ||
.pipe(gulp.dest(bundlejsPath)); | ||
} | ||
var bootPath = path.join(currentPath,'./src/js/boot.js'); | ||
var webpackPath = path.join(currentPath,'./webpack.config.js'); | ||
var bundlejsPath = path.join(currentPath,'./src'); | ||
var lessPath = path.join(currentPath,'./src/css/**/*.less'); | ||
var bundlecssPath = path.join(currentPath,'./src'); | ||
var jsPath = path.join(currentPath,'./src/js/*.js'); | ||
var jsPathExclude = path.join(currentPath,'./src/js/tags.js'); | ||
handtag(); | ||
handless(); | ||
handwebpack(); | ||
server(type,port) | ||
gulp.watch(tagsPath,function(){ | ||
handtag(); | ||
handwebpack(); | ||
}) | ||
gulp.watch(lessPath,function(){ | ||
handless(); | ||
}) | ||
gulp.watch([jsPath,'!'+jsPathExclude,'!'+tagsDep],function(){ | ||
handwebpack(); | ||
}); | ||
gulp.watch([tagsDep],function(){ | ||
handtag(); | ||
handwebpack(); | ||
}); | ||
shell.exec('gulp dev --color '+port); | ||
} | ||
if(type === 'dist'){ | ||
gulp.src(indexPath) | ||
.pipe(usemin({ | ||
css: [ minifyCss(), rev() ], | ||
html: [ minifyHtml({ empty: true }) ], | ||
js: [ uglify(), rev(), stripDebug() ], | ||
inlinejs: [ uglify(), stripDebug() ], | ||
inlinecss: [ minifyCss, 'concat' ] | ||
})) | ||
.pipe(gulp.dest('./dist')) | ||
shell.exec('gulp dist --color'); | ||
} | ||
} |
import 'babel-polyfill'; | ||
import $ from 'jquery'; | ||
import './mock'; | ||
import store from './store'; | ||
import http from './http'; | ||
import flux from 'riot-seed-flux'; | ||
// import Data from './data'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
25
4
23652
20
575