Sunday, 3 November 2019

Babel does not grab my configuration file

Hello all!I am trying to use Babel with my Nodejs project in order to use aliases but I do not manage to get it right. It is like Babel does not catch my configuration. I have my src folder and then babel.config.js at the same level as package.json.My command is as follows:"build": "babel -d dist src"My dependencies are:``` "devDependencies": { "@babel/core": "7.6.4", "@babel/plugin-transform-runtime": "7.6.2", "@babel/preset-env": "7.6.3", "babel-cli": "6.26.0", "babel-jest": "24.9.0", "babel-plugin-module-resolver": "3.2.0" }```My babel.config.js is as follows but it does not print anything so it is not used...```console.log("Works"); module.exports = function (api) { api.cache(true); const presets = [[ '@babel/preset-env' ]];const plugins = [ [ "babel-plugin-module-resolver", { root: ["./src"], alias: { "@auth": "auth", "@models": "models" } }] ]; return { presets, plugins }; };```Any ideas? Thank you in advance and regards.

Submitted November 03, 2019 at 05:32PM by dejavits

No comments:

Post a Comment