Skip to content

Instantly share code, notes, and snippets.

@leeight
Last active August 29, 2015 13:57
Show Gist options
  • Save leeight/9910941 to your computer and use it in GitHub Desktop.
Save leeight/9910941 to your computer and use it in GitHub Desktop.
app/ecom/brandlandscape/trunk/brand_landscape/bl-fe/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 e0c8faa..a3a29a8 100644
--- a/edp-build-config.js
+++ b/edp-build-config.js
@@ -3,58 +3,48 @@ 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( {
- exclude: [
- '*'
- ],
- include: [
+ files: [
'index.html',
'src/common/css/main.less'
- ],
- entryExtnames: pageEntries
+ ]
} ),
- // new CssCompressor(),
+ new CssCompressor(),
new ModuleCompiler( {
- exclude: [
- 'dep/etpl/*/src/main.js'
- ],
- configFile: 'module.conf',
- entryExtnames: moduleEntries
+ files: [
+ 'moment.js',
+ 'src/common/main.js'
+ ]
} ),
- // 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' },
- { extnames: 'css,less', replacer: 'css' }
- ],
- from: 'src',
- to: 'asset'
- } )
+ new TplMerge({
+ files: [ 'src/common/main.js' ]
+ }),
+ new JsCompressor({
+ files: [
+ 'moment.js',
+ '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',
+ 'tool',
+ 'doc',
+ 'test',
+ 'module.conf',
+ 'dep/packages.manifest',
+ 'dep/*/*/test',
+ 'dep/*/*/doc',
+ 'dep/*/*/demo',
+ 'dep/*/*/tool',
+ 'dep/*/*/*.md',
+ 'dep/*/*/package.json',
+ 'edp-*',
+ '.edpproj',
'.svn',
'.git',
'.gitignore',
@@ -66,8 +56,8 @@ exports.exclude = [
'*.tmp',
'*.bak',
'*.swp',
- '/index-debug.html',
- '/mockup',
+ 'index-debug.html',
+ 'mockup',
'build.sh'
];
diff --git a/edp-webserver-config.js b/edp-webserver-config.js
index 8901ae7..d94ec10 100644
--- a/edp-webserver-config.js
+++ b/edp-webserver-config.js
@@ -30,7 +30,7 @@ function loadMockup(request) {
return require(mockModuleName);
}
catch (e) {
- console.log('Mockup missed: '.red + path.red);
+ console.log('Mockup missed: ' + path);
return null;
}
}
@@ -115,14 +115,14 @@ exports.getLocations = function () {
return;
}
- console.log('Mockup hit: '.green + request.pathname);
+ console.log('Mockup hit: ' + 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);
+ console.log('Handle path: ' + path);
// 初始化对应的响应处理器名称,
// e.g. GET/b/c其对应的处理器:get_b_c
@@ -159,7 +159,7 @@ exports.getLocations = function () {
}
catch (e) {
context.status = 500;
- console.log('\nError Happen: '.red + e.toString().red + '\n');
+ console.log('\nError Happen: ' + e.toString() + '\n');
context.start();
}
}
diff --git a/index-debug.html b/index-debug.html
index 8e1b39a..45c7a56 100644
--- a/index-debug.html
+++ b/index-debug.html
@@ -35,7 +35,7 @@
<script>
require.config({
- 'baseUrl': 'http://test1.com:8848/src',
+ 'baseUrl': 'src',
'paths': {
'tpl': 'common/ecma/tpl',
'ecma': 'common/ecma'
@@ -73,7 +73,7 @@ require.config({
},
{
'name': 'moment',
- 'location': '../dep/moment/2.0.0/src',
+ 'location': '../dep/moment/2.0.1/src',
'main': 'moment'
},
{
diff --git a/index.html b/index.html
index 947d8f5..0c85021 100644
--- a/index.html
+++ b/index.html
@@ -74,7 +74,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 13c324d..b67347a 100644
--- a/module.conf
+++ b/module.conf
@@ -1,58 +1,69 @@
{
"baseUrl": "src",
"paths": {
- "tpl": "src/common/ecma/tpl",
- "ecma": "src/common/ecma",
- "u": "src/common/ecma/extension/underscore"
+ "tpl": "common/ecma/tpl",
+ "ecma": "common/ecma",
+ "u": "common/ecma/extension/underscore"
},
"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.6/src",
+ "location": "../dep/er/3.1.0-alpha.6/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.8/src",
+ "location": "../dep/etpl/2.0.8/src",
"main": "main"
},
{
"name": "esui",
- "location": "dep/esui/3.1.0-alpha.6/src",
+ "location": "../dep/esui/3.1.0-alpha.6/src",
"main": "main"
},
{
"name": "underscore",
- "location": "dep/underscore/1.4.4/src",
+ "location": "../dep/underscore/1.4.4/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"
}
- ]
-}
\ No newline at end of file
+ ],
+ "combine": {
+ "common/main": {
+ "files": [
+ "esui/**",
+ "ecma/**",
+ "promotion/**",
+ "!moment/**",
+ "!moment"
+ ]
+ }
+ }
+}
diff --git a/src/common/ecma/mvc/BaseView.js b/src/common/ecma/mvc/BaseView.js
index 4b2d2e3..6dbbb41 100644
--- a/src/common/ecma/mvc/BaseView.js
+++ b/src/common/ecma/mvc/BaseView.js
@@ -104,7 +104,7 @@ define(
};
options = u.defaults({}, options, defaults);
- var ui = require('esui/main');
+ var ui = require('esui');
var dialog = ui.create('Dialog', options);
//使用默认foot,改变显示文字
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment