Skip to content

Commit

Permalink
Move babel config to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinovantes committed May 13, 2022
1 parent 0001584 commit 4f2d330
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
29 changes: 29 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
presets: [
'@babel/preset-env',
'@babel/preset-typescript',
],

plugins: [
[
'@babel/transform-runtime',
],
[
'babel-plugin-root-import',
{
paths: [
{
rootPathSuffix: './src/',
rootPathPrefix: 'src',
},
],
},
],
[
'transform-define',
{
'DEFINE.IS_DEV': true,
},
],
],
}
18 changes: 2 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@
"exStart": "cross-env NODE_ENV=production node -r source-map-support/register dist/example/www.js",
"exAnalyze": "webpack-bundle-analyzer dist/example/public/stats.json"
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-typescript"
],
"plugins": [
[
"@babel/transform-runtime"
],
[
"transform-define",
{}
]
]
},
"jest": {
"bail": true,
"setupFiles": [
Expand Down Expand Up @@ -70,7 +55,8 @@
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.19.0",
"@vue/server-renderer": "^3.2.33",
"babel-plugin-transform-define": "^2.0.0",
"babel-plugin-root-import": "^6.6.0",
"babel-plugin-transform-define": "^2.0.1",
"copy-webpack-plugin": "^10.2.4",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,14 @@ babel-plugin-polyfill-regenerator@^0.3.0:
dependencies:
"@babel/helper-define-polyfill-provider" "^0.3.1"

babel-plugin-transform-define@^2.0.0:
babel-plugin-root-import@^6.6.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/babel-plugin-root-import/-/babel-plugin-root-import-6.6.0.tgz#85940840f308a8c292f66ca0b5bdd314046273ed"
integrity sha512-SPzVOHd7nDh5loZwZBxtX/oOu1MXeKjTkz+1VnnzLWC0dk8sJIGC2IDQ2uWIBjE5mUtXlQ35MTHSqN0Xn7qHrg==
dependencies:
slash "^3.0.0"

babel-plugin-transform-define@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/babel-plugin-transform-define/-/babel-plugin-transform-define-2.0.1.tgz#6a34fd6ea89989feb75721ee4cce817ec779be7f"
integrity sha512-7lDR1nFGSJHmhq/ScQtp9LTDmNE2yKPoLtwfiu+WQZnj84XL/J/5AZWZXwYcOwbDtUPhtg+y0yxTiP/oGDU6Kw==
Expand Down

0 comments on commit 4f2d330

Please sign in to comment.