1 | 'use strict';
|
2 |
|
3 | var fs = require('fs');
|
4 | var path = require('path');
|
5 | module.exports = function (source, map) {
|
6 | var comNameAry = this.resourcePath.split(path.sep);
|
7 | var filePath = this.resourcePath;
|
8 | var appPath = fs.realpathSync(process.cwd());
|
9 | var changePath = filePath.replace('/lib/', '/src/');
|
10 | var comName = comNameAry[comNameAry.length - 1];
|
11 | var name = comName.substring(0, comName.lastIndexOf('.'));
|
12 | var src = fs.readFileSync(filePath.startsWith(appPath) ? filePath : changePath).toString();
|
13 | return source + ';' + name + '.source=' + JSON.stringify(src) + ';' + name + '.filePath=' + JSON.stringify(filePath);
|
14 | }; |
\ | No newline at end of file |