Skip to content

Instantly share code, notes, and snippets.

@leeight
Last active August 29, 2015 13:57
Show Gist options
  • Save leeight/9911134 to your computer and use it in GitHub Desktop.
Save leeight/9911134 to your computer and use it in GitHub Desktop.
app/ecom/nmplt/trunk/muses-web/src/main/webapp
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..53752db
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+output
diff --git a/edp-build-config.js b/edp-build-config.js
index 9f017bf..c12c9e9 100644
--- a/edp-build-config.js
+++ b/edp-build-config.js
@@ -3,47 +3,40 @@ exports.input = __dirname;
var path = require( 'path' );
exports.output = path.resolve( __dirname, 'output' );
-var moduleEntries = 'html,htm,phtml,tpl,vm,js';
-var pageEntries = 'html,htm,phtml,tpl,vm';
-
exports.getProcessors = function () {
- return [
- new LessCompiler( {
- entryExtnames: pageEntries
- } ),
- new CssCompressor(),
- new ModuleCompiler( {
- configFile: 'module.conf',
- entryExtnames: moduleEntries
- } ),
- new JsCompressor(),
- new PathMapper( {
- replacements: [
- { type: 'html', tag: 'link', attribute: 'href', extnames: pageEntries },
- { type: 'html', tag: 'img', attribute: 'src', extnames: pageEntries },
- { type: 'html', tag: 'script', attribute: 'src', extnames: pageEntries },
- { extnames: moduleEntries, replacer: 'module-config' }
+ return [
+ new LessCompiler({
+ files: [
+ 'src/common/css/main.less'
],
- from: 'src',
- to: 'asset'
- } )
+ entryFiles: [
+ 'index.html'
+ ]
+ }),
+ // new CssCompressor(),
+ new ModuleCompiler({
+ files: [ 'src/common/main.js' ]
+ }),
+ // new JsCompressor({
+ // files: [ 'src/common/main.js' ]
+ // }),
+ new PathMapper()
];
};
exports.exclude = [
- '/tool',
- '/doc',
- '/test',
- '/module.conf',
- '/dep/packages.manifest',
- '/dep/*/*/test',
- '/dep/*/*/doc',
- '/dep/*/*/demo',
- '/dep/*/*/tool',
- '/dep/*/*/*.md',
- '/dep/*/*/package.json',
- '/edp-*',
- '/.edpproj',
+ 'doc',
+ 'test',
+ 'module.conf',
+ 'dep/packages.manifest',
+ 'dep/*/*/test',
+ 'dep/*/*/doc',
+ 'dep/*/*/demo',
+ 'dep/*/*/*.md',
+ 'dep/*/*/package.json',
+ 'dep/*/*/index.html',
+ 'edp-*',
+ '.edpproj',
'.svn',
'.git',
'.gitignore',
@@ -55,7 +48,7 @@ exports.exclude = [
'*.tmp',
'*.bak',
'*.swp',
- '/mockup'
+ 'mockup'
];
exports.injectProcessor = function ( processors ) {
diff --git a/edp-webserver-config.js b/edp-webserver-config.js
index 7fef19b..22bfbd9 100644
--- a/edp-webserver-config.js
+++ b/edp-webserver-config.js
@@ -32,7 +32,6 @@ var mockup = (function() {
return require(mockModuleName);
}
catch (e) {
- console.log('Mockup missed: '.red + path.red);
return null;
}
}
@@ -52,15 +51,11 @@ var mockup = (function() {
return;
}
- console.log('Mockup hit: '.green + request.pathname);
-
// 如果查询参数包含path信息,则默认使用该path
var query = qs.parse(request.search.substr(1));
var path;
var reqHandlerKey;
if (path = query.path) {
- console.log('Handle path: '.green + path);
-
// 初始化对应的响应处理器名称,
// e.g. GET/b/c其对应的处理器:get_b_c
reqHandlerKey = path.replace(/\//g, '_').toLowerCase();
@@ -96,7 +91,6 @@ var mockup = (function() {
}
catch (e) {
context.status = 500;
- console.log('\nError Happen: '.red + e.toString().red + '\n');
context.start();
}
}
diff --git a/index.html b/index.html
index 7a93550..f2275da 100644
--- a/index.html
+++ b/index.html
@@ -41,9 +41,9 @@ require.config({
},
'packages': [
{
- "name": "ecma",
- "location": "../dep/bat-ria",
- "main": "main"
+ 'name': 'ecma',
+ 'location': '../dep/bat-ria',
+ 'main': 'main'
},
{
'name': 'ef',
@@ -77,7 +77,7 @@ require.config({
},
{
'name': 'moment',
- 'location': '../dep/moment/2.0.0/src',
+ 'location': '../dep/moment/2.0.1/src',
'main': 'moment'
},
{
diff --git a/module.conf b/module.conf
index 69da5b8..d109e01 100644
--- a/module.conf
+++ b/module.conf
@@ -1,72 +1,81 @@
{
"baseUrl": "src",
"paths": {
- "ecma": "src/common/bat-ria",
- "tpl": "src/common/bat-ria/tpl"
+ "ecma": "common/bat-ria",
+ "tpl": "common/bat-ria/tpl"
},
"packages": [
{
"name": "ef",
- "location": "dep/ef/3.1.0-alpha.3/src",
+ "location": "../dep/ef/3.1.0-alpha.3/src",
"main": "main"
},
{
"name": "er",
- "location": "dep/er/3.1.0-alpha.8/src",
+ "location": "../dep/er/3.1.0-alpha.8/src",
"main": "main"
},
{
"name": "mini-event",
- "location": "dep/mini-event/1.0.0/src",
+ "location": "../dep/mini-event/1.0.0/src",
"main": "main"
},
{
"name": "etpl",
- "location": "dep/etpl/2.0.10/src",
+ "location": "../dep/etpl/2.0.10/src",
"main": "main"
},
{
"name": "esui",
- "location": "dep/esui/3.1.0-alpha.8/src",
+ "location": "../dep/esui/3.1.0-alpha.8/src",
"main": "main"
},
{
"name": "underscore",
- "location": "dep/underscore/1.5.2/src",
+ "location": "../dep/underscore/1.5.2/src",
"main": "underscore"
},
{
"name": "moment",
- "location": "dep/moment/2.0.0/src",
+ "location": "../dep/moment/2.0.1/src",
"main": "moment"
},
{
"name": "esf-ms",
- "location": "dep/esf-ms/1.0.2/src"
+ "location": "../dep/esf-ms/1.0.2/src"
},
{
"name": "est",
- "location": "dep/est/1.1.0/src"
+ "location": "../dep/est/1.1.0/src"
},
{
"name": "urijs",
- "location": "dep/urijs/1.12.0/src",
+ "location": "../dep/urijs/1.12.0/src",
"main": "URI"
},
{
"name": "json2",
- "location": "dep/json2/1.0.0/src",
+ "location": "../dep/json2/1.0.0/src",
"main": "json2"
},
{
"name": "echarts",
- "location": "dep/echarts/1.3.8/src",
+ "location": "../dep/echarts/1.3.8/src",
"main": "echarts"
},
{
"name": "zrender",
- "location": "dep/zrender/1.1.0/src",
+ "location": "../dep/zrender/1.1.0/src",
"main": "zrender"
}
- ]
+ ],
+ "combine": {
+ "common/main": {
+ "files": [
+ "~er", "~esui", "~etpl", "~urijs",
+ "~ef", "~bat-ria", "echarts", "echarts/chart/bar",
+ "~common"
+ ]
+ }
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment