Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-50-extensions / test-x-index.js
421 bytesRaw
1 | /* eslint-disable no-underscore-dangle */ |
2 | |
3 | var Module = require('module'); |
4 | var fs = require('fs'); |
5 | |
6 | Module._extensions['.js'] = function (module, filename) { |
7 | var content = fs.readFileSync(filename, 'utf8'); |
8 | // emulating babel-register |
9 | content = content.replace( |
10 | 'import x from \'./test-z-sub.js\';', |
11 | 'require(\'./test-z-sub.js\');'); |
12 | module._compile(content, filename); |
13 | }; |
14 | |
15 | require('./test-y-esnext.js'); |
16 |
Built with git-ssb-web