This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created Date: Friday, September 8th 2017, 6:50:56 pm | |
* Author: hefangshi | |
* Copyright (c) 2017 Baidu.Inc | |
* | |
*/ | |
class Job { | |
constructor() { | |
this.running = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fis.enableNPM = function(options) { | |
fis.match('/node_modules/**.js', { | |
isMod: true | |
}); | |
if (options.autoPack) { | |
fis.match('/node_modules/**.js', { | |
packTo: options.npmBundlePath || '/pkg/npm/bundle.js' | |
}); | |
fis.match('/node_modules/**.css', { | |
packTo: options.npmCssBundlePath || '/pkg/npm/bundle.css' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var http = require('http'); | |
var cacheDir = __dirname + '/fileCache'; | |
var fs = require('fs-extra'); | |
var url = require('url'); | |
var path = require('path'); | |
var mime = require('mime'); | |
mime.default_type = -1; | |
var server = http.createServer(function (req, resp) { | |
var urlparse = url.parse(req.url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bowerPath = fis.config.get('bower.path') || 'bower_components'; | |
fis.config.set('project.exclude', bowerPath); | |
var fs = require('fs'); | |
var path = require('path'); | |
var originGetSource = fis.project.getSource; | |
function loadAllBowerFile(componentPath, source) { | |
var exclude = fis.config.get('project.exclude'); | |
var root = fis.project.getProjectPath(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fis.config.set('settings.postpackager.autoload', { | |
a : 1 | |
}); | |
fis.config.set('settings.postpackager.autoload', { | |
b : 1 | |
}); | |
//settings.postpackager.autoload = {b:1} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extJs(content){ | |
var map = fis.compile.lang; | |
var reg = /"(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*'|(\/\/[^\r\n\f]+|\/\*[\s\S]*?(?:\*\/|$))|\b(F_require)\s*\(\s*("(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*')\s*\)/g; | |
function callback(m, comment, type, value){ | |
if(type){ | |
switch (type){ | |
case 'F_require': | |
m = 'F_require(' + map.require.ld + value + map.require.rd + ')'; | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//使用方法:将配置代码保存在项目根目录的fis-conf.js文件中 | |
//如果添加配置前没有使用任何fis-conf配置,那么首次发布时需添加参数-c清除编译缓存 | |
fis.config.set('roadmap.path', [ | |
{ | |
reg: '**', | |
useStandard: false | |
} | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
namespace RandomContent | |
{ | |
public interface RandomContent | |
{ | |
string MakeRandom(string content); | |
} |