diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 000000000..ba5fb57fb --- /dev/null +++ b/babel.config.js @@ -0,0 +1,29 @@ +module.exports = function(api) { + api.cache(false); + const presets = [ + [ + "@babel/preset-env", + { + "corejs": { "version": 3 }, + "useBuiltIns": "usage", + "targets": { + "edge": "17", + "firefox": "60", + "chrome": "67", + "safari": "11.1", + "ie": "11" + } + } + ] + ]; + const plugins = [ + ["@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true }], + ["@babel/plugin-proposal-class-properties"], + ["@babel/transform-runtime"] + ]; + + return { + presets, + plugins + }; +}; diff --git a/package.json b/package.json index 59eed490a..5d44ee810 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ }, "dependencies": { "@babel/core": "^7.16.10", + "@babel/plugin-proposal-class-properties": "^7.16.7", + "@babel/plugin-proposal-decorators": "^7.17.2", "@babel/plugin-transform-runtime": "^7.16.10", "@babel/preset-env": "^7.16.10", "@babel/runtime": "^7.16.7", @@ -47,11 +49,6 @@ "resolutions": { "chokidar": "^3.5.2" }, - "babel": { - "presets": [ - "./node_modules/shakapacker/package/babel/preset.js" - ] - }, "browserslist": [ "defaults" ], diff --git a/yarn.lock b/yarn.lock index 9135decf5..79f195537 100644 --- a/yarn.lock +++ b/yarn.lock @@ -76,7 +76,7 @@ browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.6": +"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.1", "@babel/helper-create-class-features-plugin@^7.17.6": version "7.17.6" resolved "https://registry.npmmirror.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9" integrity sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg== @@ -314,6 +314,17 @@ "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-class-static-block" "^7.14.5" +"@babel/plugin-proposal-decorators@^7.17.2": + version "7.17.2" + resolved "https://registry.npmmirror.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.17.2.tgz#c36372ddfe0360cac1ee331a238310bddca11493" + integrity sha512-WH8Z95CwTq/W8rFbMqb9p3hicpt4RX4f0K659ax2VHxgOyT6qQmUaEVEjIh4WR9Eh9NymkVn5vwsrE68fAQNUw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.17.1" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/plugin-syntax-decorators" "^7.17.0" + charcodes "^0.2.0" + "@babel/plugin-proposal-dynamic-import@^7.16.7": version "7.16.7" resolved "https://registry.npmmirror.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz#c19c897eaa46b27634a00fee9fb7d829158704b2" @@ -437,6 +448,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" +"@babel/plugin-syntax-decorators@^7.17.0": + version "7.17.0" + resolved "https://registry.npmmirror.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.17.0.tgz#a2be3b2c9fe7d78bd4994e790896bc411e2f166d" + integrity sha512-qWe85yCXsvDEluNP0OyeQjH63DlhAR3W7K9BxxU1MvbDb48tgBG+Ao6IJJ6smPDrrVzSQZrbF6donpkFBMcs3A== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" resolved "https://registry.npmmirror.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" @@ -1625,6 +1643,11 @@ chalk@^4.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +charcodes@^0.2.0: + version "0.2.0" + resolved "https://registry.npmmirror.com/charcodes/-/charcodes-0.2.0.tgz#5208d327e6cc05f99eb80ffc814707572d1f14e4" + integrity sha512-Y4kiDb+AM4Ecy58YkuZrrSRJBDQdQ2L+NyS1vHHFtNtUjgutcZfx3yp1dAONI/oPaPmyGfCLx5CxL+zauIMyKQ== + "chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmmirror.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"