forked from alleyinteractive/irving
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabelTransform.js
37 lines (35 loc) · 928 Bytes
/
babelTransform.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const path = require('path');
const getServiceAliases = require(
'./packages/core/config/irving/getServiceAliases'
);
const { irvingRoot, mocks } = require('./packages/core/config/paths');
const babelOptions = {
plugins: [
[
'module-resolver',
{
root: [irvingRoot],
// Tests need an irving config, use an alias so it doesn't override user config.
alias: {
...getServiceAliases('node'),
'@irvingjs/irving.config': path.join(
mocks,
'irving.config.js'
),
'@irvingjs/multisite.config': path.join(
mocks,
'multisite.config.js'
),
'@irvingjs/componentMap': path.join(
mocks,
'componentMap.js'
),
},
},
],
],
presets: [
'@irvingjs/irving',
],
};
module.exports = require('babel-jest').createTransformer(babelOptions);