-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,382 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
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 ]; | ||
} | ||
}; | ||
|
This file contains 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
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 ]; | ||
} | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"baseUrl": "src", | ||
"paths": {}, | ||
"packages": [] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.