ohif-viewer/babel.config.js

51 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2019-07-16 20:23:41 +02:00
const aliases = require("./aliases.config");
const path = require("path");
2019-07-04 22:12:43 +02:00
module.exports = {
// https://babeljs.io/docs/en/options#babelrcroots
2019-07-04 22:12:43 +02:00
presets: [
2019-04-25 21:35:11 +02:00
[
2019-07-16 20:23:41 +02:00
"@babel/preset-env",
2019-04-25 21:35:11 +02:00
{
2019-07-04 22:12:43 +02:00
targets: {
2019-07-16 20:23:41 +02:00
ie: "11"
}
}
2019-04-25 21:35:11 +02:00
],
2019-07-16 20:23:41 +02:00
"@babel/preset-react"
],
2019-07-16 20:23:41 +02:00
babelrcRoots: ["./platform/*", "./extensions/*"],
2019-07-04 22:12:43 +02:00
plugins: [
2019-07-17 20:57:50 +02:00
"inline-react-svg",
2019-07-16 20:23:41 +02: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 20:23:41 +02: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 20:23:41 +02:00
}
}
]
],
env: {
debug: {
2019-07-16 20:23:41 +02:00
sourceMaps: "inline",
retainLines: true
},
build: {
2019-07-16 20:23:41 +02:00
ignore: ["**/*.test.jsx", "**/*.test.js", "__snapshots__", "__tests__"]
}
}
// ignore: ["node_modules"]
2019-07-04 22:12:43 +02:00
};