зеркало из https://github.com/docker/kitematic.git
Коммит
6ab01fb4a3
|
@ -27,6 +27,7 @@
|
|||
"jest": {
|
||||
"scriptPreprocessor": "<rootDir>/util/preprocessor.js",
|
||||
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
|
||||
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
|
||||
"collectCoverage": true,
|
||||
"testDirectoryName": "src",
|
||||
"testPathIgnorePatterns": [
|
||||
|
@ -42,7 +43,8 @@
|
|||
"<rootDir>/node_modules/.*JSONStream",
|
||||
"<rootDir>/node_modules/object-assign",
|
||||
"<rootDir>/node_modules/underscore",
|
||||
"<rootDir>/node_modules/bluebird"
|
||||
"<rootDir>/node_modules/bluebird",
|
||||
"<rootDir>/node_modules/source-map-support"
|
||||
]
|
||||
},
|
||||
"docker-version": "1.6.0",
|
||||
|
@ -93,6 +95,7 @@
|
|||
"jsxhint": "^0.14.0",
|
||||
"minimist": "^1.1.1",
|
||||
"react-tools": "^0.13.1",
|
||||
"run-sequence": "^1.0.2"
|
||||
"run-sequence": "^1.0.2",
|
||||
"source-map-support": "^0.2.10"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
require.requireActual('babel/polyfill');
|
||||
require.requireActual('source-map-support').install({
|
||||
retrieveSourceMap: function(filename) {
|
||||
if (filename.indexOf('node_modules') === -1) {
|
||||
try {
|
||||
return {
|
||||
map: require.requireActual('fs').readFileSync('/tmp/' + require('crypto').createHash('md5').update(filename).digest('hex') + '.map', 'utf8')
|
||||
};
|
||||
} catch (err) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,12 +1,14 @@
|
|||
var babel = require('babel');
|
||||
var fs = require('fs');
|
||||
var crypto = require('crypto');
|
||||
|
||||
module.exports = {
|
||||
process: function(src, filename) {
|
||||
if (filename.indexOf('node_modules') === -1) {
|
||||
var res = require('babel').transform(src).code;
|
||||
if (filename.indexOf('-test') !== -1) {
|
||||
res = 'require(\'babel/polyfill\');' + res;
|
||||
}
|
||||
return res;
|
||||
if (filename.indexOf('node_modules') !== -1) {
|
||||
return src;
|
||||
}
|
||||
return src;
|
||||
var compiled = babel.transform(src, {filename: filename, sourceMap: true});
|
||||
fs.writeFileSync('/tmp/' + crypto.createHash('md5').update(filename).digest('hex') + '.map', JSON.stringify(compiled.map));
|
||||
return compiled.code;
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче