From f6d10f1a7aa9ba93bf8707a21bd87dfeaf364889 Mon Sep 17 00:00:00 2001 From: a-sabagh Date: Sat, 21 Jan 2023 05:47:28 +0330 Subject: [PATCH] install and configure babel loader and presets --- package.json | 5 +++++ webpack.config.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/package.json b/package.json index f53a56a..c0fb5d1 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,14 @@ }, "homepage": "https://github.com/a-sabagh/rock-paper-scissor#readme", "devDependencies": { + "@babel/core": "^7.20.12", + "@babel/preset-env": "^7.20.2", + "babel-loader": "^9.1.2", "css-loader": "^6.7.3", "html-webpack-plugin": "^5.5.0", + "install": "^0.13.0", "mini-css-extract-plugin": "^2.7.2", + "npm": "^9.3.1", "webpack": "^5.75.0", "webpack-cli": "^5.0.1" } diff --git a/webpack.config.js b/webpack.config.js index d8b4da5..3e10e40 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,6 +17,16 @@ module.exports = { test: /\.css$/i, use: [MiniCssExtractPlugin.loader, "css-loader"], }, + { + test: /\.js$/i, + use: { + loader: 'babel-loader', + options: { + exclude: ['node_modules'], + presets: ['@babel/preset-env'] + } + } + }, ] }, plugins: [