Files
ohif-viewer/babel.config.js
T

50 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2019-07-16 14:23:41 -04:00
const aliases = require("./aliases.config");
const path = require("path");
2019-07-04 16:12:43 -04:00
module.exports = {
// https://babeljs.io/docs/en/options#babelrcroots
2019-07-04 16:12:43 -04:00
presets: [
2019-04-25 15:35:11 -04:00
[
2019-07-16 14:23:41 -04:00
"@babel/preset-env",
2019-04-25 15:35:11 -04:00
{
2019-07-04 16:12:43 -04:00
targets: {
2019-07-16 14:23:41 -04:00
ie: "11"
}
}
2019-04-25 15:35:11 -04:00
],
2019-07-16 14:23:41 -04:00
"@babel/preset-react"
],
2019-07-16 14:23:41 -04:00
babelrcRoots: ["./platform/*", "./extensions/*"],
2019-07-04 16:12:43 -04:00
plugins: [
2019-07-17 14:57:50 -04:00
"inline-react-svg",
2019-07-16 14:23:41 -04:00
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-runtime",
[
2019-07-16 14:23:41 -04:00
"module-resolver",
{
// https://github.com/tleunen/babel-plugin-module-resolver/issues/338
// There seem to be a bug with module-resolver with a mono-repo setup:
// It doesn't resolve paths correctly when using root/alias combo, so we
// use this function instead.
resolvePath(sourcePath, currentFile, opts) {
// This will return undefined if aliases has no key for the sourcePath,
// in which case module-resolver will fallback on its default behaviour.
return aliases[sourcePath];
2019-07-16 14:23:41 -04:00
}
}
]
],
env: {
debug: {
2019-07-16 14:23:41 -04:00
sourceMaps: "inline",
retainLines: true
},
build: {
2019-07-16 14:23:41 -04:00
ignore: ["**/*.test.jsx", "**/*.test.js", "__snapshots__", "__tests__"]
}
2019-07-18 10:26:33 -04:00
}
// ignore: ["node_modules"]
2019-07-04 16:12:43 -04:00
};