Great work. Please can you help me on using this with babel to transpile es6 and above down to es5
Here you go.
Install the dependencies:
npm i babel-core babel-loader babel-preset-env --save-dev
Configure .babelrc:
.babelrc
{ "presets": [ "env" ] }
Create webpack.config.js for webpack:
webpack.config.js
module.exports = { module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] } };
You can also avoid the configuration file by placing the loader inside the build script:
"scripts": { "dev": "webpack --mode development --module-bind js=babel-loader", "build": "webpack --mode production --module-bind js=babel-loader" }
Wow, that is awesome. Less work to be done. Thank you
It does not work for me.Maybe I am doing something wrong. I have es6 sample project that uses gulp to transpile. I replaced the project to use webpack 4 and the babel dependencies but it is not working for me.
Maybe you can have a look at both project and help me out. webpack project Gulp project
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great work.
Please can you help me on using this with babel to transpile es6 and above down to es5
Here you go.
Install the dependencies:
Configure
.babelrc
:Create
webpack.config.js
for webpack:You can also avoid the configuration file by placing the loader inside the build script:
Wow, that is awesome. Less work to be done. Thank you
It does not work for me.Maybe I am doing something wrong.
I have es6 sample project that uses gulp to transpile. I replaced the project to use webpack 4 and the babel dependencies but it is not working for me.
Maybe you can have a look at both project and help me out.
webpack project
Gulp project