1. 8
    Configure webpack to Load JavaScript Files through Babel with babel-loader
    2m 17s

Configure webpack to Load JavaScript Files through Babel with babel-loader

InstructorAndy Van Slaars

Share this video with your friends

Send Tweet

In this lesson, we'll configure webpack to use the Babel loader for our JavaScript files, allowing us to transpile our source files and generate a bundle for deploying our application.

Victor Villacis
~ 2 years ago

My output file does have a string using the .concact method. However, the arrow function and const still there. Where there any updates done to the packages, that the expected output is now different. This is my output.

(()=>{"use strict";const o="Hello, ".concat(phrase,"!");console.log(o("World"))})();

The only time my code matches yours is when I add target: ["web", "es5"] to the webpack.config.js file and even then the output is !function(){"use strict";var o="Hello, ".concat(phrase,"!");console.log(o("World"))}();

mdehghani65
~ 2 years ago

if you encounter this error below : Error: Cannot find module 'fs/promises' make sure you have installed "babel-loader": "^8.0.5"