>> Tutorial Webpack for Beginners
1. What is Loaders
- Perform transfromations
- E.g Balel loader transform ES2015 or JSX in vanilla JS
- Many more loaders for other things too (such as SASS)
2. How to using Babel loader
- Install babel-core and babe-loader via npm
- Install any presets we will be using to perform transformations
- Configure webpack.config to tell webpack to use babel to transform our code
3. Step by step using
* Install babel
* Configure webpack.config.js
- test: /\.js$/, //just wanted run on .js file
- exclude: /(node_modules)/, // tell webpack exclude certain files
- loader: 'babel-loader', // which loader we use is babel-loader
- presets: ['es2015'] // which presets we use is es2015 to JavaScript
* Running webpack
>> Tutorial Webpack for Beginners
Thank you

No comments:
Post a Comment