Skip to content

Commit 908c8d5

Browse files
committed
feat(ui-babel-preset): allow for specifying additional import transforms
TEST PLAN: - Automated tests should pass - yarn start and yarn dev should still run docs Change-Id: Iaf2f9dea9a805ef1697a7aa5e7559ce653af585c Reviewed-on: https://gerrit.instructure.com/c/instructure-ui/+/223814 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Ken Meleta <kmeleta@instructure.com> Product-Review: Steve Jensen <sejensen@instructure.com> QA-Review: Daniel Sasaki <dsasaki@instructure.com> Visual-Regression-Test: Steve Jensen <sejensen@instructure.com>
1 parent c1f0dc0 commit 908c8d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/ui-babel-preset/lib/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = function (context, opts = {
3030
coverage: false,
3131
node: false,
3232
removeConsole: false,
33-
transformImports: true
33+
transformImports: true,
34+
importTransforms: {}
3435
}) {
3536
const envPresetConfig = opts.node ? getNodeEnvConfig() : getWebEnvConfig(opts)
3637

@@ -62,7 +63,8 @@ module.exports = function (context, opts = {
6263
if (!matches || !matches[1]) return
6364
return matches[1].replace(new RegExp('/es/'), '/lib/')
6465
}
65-
}
66+
},
67+
...(opts.importTransforms || {})
6668
}
6769
])
6870
}

0 commit comments

Comments
 (0)