Skip to content

Instantly share code, notes, and snippets.

@samuelastech
Created October 3, 2022 19:17
Show Gist options
  • Save samuelastech/f3193be83b4494a0145aa996e4c37995 to your computer and use it in GitHub Desktop.
Save samuelastech/f3193be83b4494a0145aa996e4c37995 to your computer and use it in GitHub Desktop.
Babel setup
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
'@babel/preset-typescript'
],
plugins: [
[
'module-resolver', {
alias: {
'@controllers/*': './src/controllers/*',
'@models/*': './src/models/*',
'@views/*': './src/views/*'
}
}
]
],
ignore: [
'**/*.spec.ts'
]
}
{
scripts": {
"build": "babel src --extensions \".js,.ts\" --out-dir dist --copy-files --no-copy-ignored"
},
"devDependencies": {
"@babel/cli": "...",
"@babel/core": "...",
"@babel/node": "...",
"@babel/preset-env": "...",
"@babel/preset-typescript": "...",
"babel-plugin-module-resolver": "..."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment