forked from karrot-dev/karrot-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
34 lines (34 loc) · 969 Bytes
/
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
module.exports = {
presets: [
['@babel/preset-env', {
modules: false,
useBuiltIns: 'usage',
}],
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-runtime',
],
env: {
test: {
plugins: [
// During testing we need a dynamic import implemention for nodejs
'babel-plugin-dynamic-import-node',
// Jest wants commonjs modules so we transform them
'@babel/plugin-transform-modules-commonjs',
],
},
production: {
plugins: [
// To enable tree-shaking support in quasar in production we rewrite imports
// This changes things like `import { QBtn } from 'quasar'` into `import QBtn from 'quasar/blah/QBtn'`
['babel-plugin-transform-imports', {
quasar: {
transform: 'quasar-framework/dist/babel-transforms/imports.mat.js',
preventFullImport: true,
},
}],
],
},
},
}