Skip to content

Commit

Permalink
edp
Browse files Browse the repository at this point in the history
  • Loading branch information
ielgnaw committed Aug 27, 2013
1 parent 347febf commit 99817f9
Show file tree
Hide file tree
Showing 6 changed files with 1,382 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
##pstiplib
##pstiplib

###安装
1. 安装nodejs环境
2. 安装edp <https://github.com/ecomfe/edp>


###使用
压缩并合并js文件

edp build -f
67 changes: 67 additions & 0 deletions edp-build-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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' }
],
from: 'src',
to: './'
} )
];
};

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',
'.svn',
'.git',
'.gitignore',
'.idea',
'.project',
'Desktop.ini',
'Thumbs.db',
'.DS_Store',
'*.tmp',
'*.bak',
'*.swp',
/* 用户自定义忽略文件 */
'README.md'
];

exports.injectProcessor = function ( processors ) {
for ( var key in processors ) {
global[ key ] = processors[ key ];
}
};

53 changes: 53 additions & 0 deletions edp-webserver-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
exports.port = 8848;
exports.directoryIndexes = true;
exports.documentRoot = __dirname;
exports.getLocations = function () {
return [
{
location: '/',
handler: home( 'index.html' )
},
{
location: /^\/redirect-local/,
handler: redirect('redirect-target', false)
},
{
location: /^\/redirect-remote/,
handler: redirect('http://www.baidu.com', false)
},
{
location: /^\/redirect-target/,
handler: content('redirectd!')
},
{
location: '/empty',
handler: empty()
},
{
location: /\.css$/,
handler: [
autoless()
]
},
{
location: /\.less$/,
handler: [
file(),
less()
]
},
{
location: /^.*$/,
handler: [
file(),
proxyNoneExists()
]
}
];
};

exports.injectResource = function ( res ) {
for ( var key in res ) {
global[ key ] = res[ key ];
}
};
5 changes: 5 additions & 0 deletions module.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"baseUrl": "src",
"paths": {},
"packages": []
}
1 change: 0 additions & 1 deletion pstiplib.js

This file was deleted.

Loading

0 comments on commit 99817f9

Please sign in to comment.