1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | module.exports = (src,isDebug)=>{
|
11 | const {path} = {
|
12 | path:require('path')
|
13 | };
|
14 |
|
15 | let correspondence = {
|
16 | '.pug':'.html',
|
17 | '.html':'.html',
|
18 | '.htm':'.htm',
|
19 | '.scss':fws.config.projectType === 'wxapp' ? '.wxss':'.css',
|
20 | '.ts':'.js',
|
21 | '.tsx':'.js',
|
22 | '.jsx':'.js',
|
23 | '.es':'.js',
|
24 | '.es6':'.js'
|
25 | },
|
26 |
|
27 | fileType = path.extname(src),
|
28 | fileName = path.basename(src,fileType),
|
29 |
|
30 |
|
31 | outExtName = correspondence[fileType] === undefined ? fileType : correspondence[fileType],
|
32 | dist = '';
|
33 |
|
34 | if(isDebug){
|
35 | dist = path.join(path.dirname(src.replace(fws.srcPath,fws.devPath)),fileName + outExtName);
|
36 | }else{
|
37 | dist = path.join(path.dirname(src.replace(fws.srcPath,fws.distPath)),fileName + outExtName);
|
38 | };
|
39 |
|
40 | return dist;
|
41 |
|
42 | };
|