mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Also switching from babelOptions.sourceMap to babelOptions.sourceMaps, finally: https://babeljs.io/docs/usage/api/#options
30 lines
907 B
JavaScript
30 lines
907 B
JavaScript
// This file exists because it is the file in the tool that is not automatically
|
|
// transpiled by Babel
|
|
|
|
"use strict";
|
|
|
|
function babelRegister() {
|
|
const meteorBabel = require("meteor-babel");
|
|
const path = require("path");
|
|
const toolsPath = path.dirname(__dirname);
|
|
const meteorPath = path.dirname(toolsPath);
|
|
const cacheDir = path.join(meteorPath, ".babel-cache");
|
|
const babelOptions = meteorBabel.getDefaultOptions({
|
|
nodeMajorVersion: parseInt(process.versions.node)
|
|
});
|
|
|
|
// Make sure that source maps are included in the generated code for
|
|
// meteor/tools modules.
|
|
babelOptions.sourceMaps = "inline";
|
|
|
|
require('meteor-babel/register')
|
|
.setCacheDirectory(cacheDir)
|
|
.allowDirectory(toolsPath)
|
|
.setSourceMapRootPath(meteorPath)
|
|
.setBabelOptions(babelOptions);
|
|
}
|
|
|
|
babelRegister(); // #RemoveInProd this line is removed in isopack.js
|
|
|
|
require("./install-runtime.js");
|