forked from SolidOS/source-pane
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.mjs
More file actions
37 lines (35 loc) · 880 Bytes
/
Copy pathbabel.config.mjs
File metadata and controls
37 lines (35 loc) · 880 Bytes
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
import path from 'path'
import { fileURLToPath } from 'url'
import { resolvePathsUsingDecorators, litDecoratorsBabelOptions } from './config/babel.mjs'
const projectRoot = path.dirname(fileURLToPath(import.meta.url))
const pathsUsingDecorators = resolvePathsUsingDecorators(projectRoot)
const isCommonJsBuild = process.env.BABEL_ENV === 'cjs' || process.env.NODE_ENV === 'test'
export default {
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
modules: isCommonJsBuild ? 'commonjs' : false,
targets: {
browsers: ['> 1%', 'last 3 versions', 'not dead']
},
},
],
],
plugins: [
[
'babel-plugin-inline-import', {
extensions: [
'.ttl'
]
}
]
],
overrides: [
{
include: pathsUsingDecorators,
...litDecoratorsBabelOptions,
}
]
}