forked from cozy/cozy-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
48 lines (46 loc) · 1.2 KB
/
babel.config.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
38
39
40
41
42
43
44
45
46
47
48
const path = require('path')
const { isUsingDevStyleguidist } = require('./scripts/build-utils')
const plugins = [
// While developing on the styleguidist, we do not want babel to touch the CSS
// otherwise CSS hot reload does not work
isUsingDevStyleguidist()
? null
: [
'css-modules-transform',
{
extensions: ['.styl'],
preprocessCss: './preprocess',
extractCss: './transpiled/react/stylesheet.css',
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
],
['inline-json-import', {}]
].filter(Boolean)
module.exports = {
presets: [
[
'cozy-app',
{ presetEnv: { modules: false }, transformRuntime: { helpers: true } }
]
],
env: {
transpilation: {
plugins: [
...plugins,
[
'./scripts/babel-transform-relative-paths-plugin.js',
{
from: path.resolve(__dirname, './react'),
to: 'cozy-ui/transpiled/react'
}
]
],
ignore: ['**/*.spec.jsx', '**/*.spec.js']
},
test: {
presets: [['cozy-app', { transformRuntime: { helpers: true } }]],
plugins: plugins
}
},
ignore: ['examples/**/*']
}