[WEBPACK] 3. Webpack : Apply Babel Cho Project (nghiepuit)
https://www.youtube.com/watch?v=_BZDmxVC2fo&list=PLJ5qtRQovuEOqsMokakP9ue-y_jXhmCwJ&index=3
C:\Users\Administrator\Desktop\webpack\dist\index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello Webpack</title>
<script type="text/javascript" src="bundle.js"></script>
</head>
<body>
</body>
</html>C:\Users\Administrator\Desktop\webpack\webpack.config.js
var path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: 'babel-loader',
}
]
}
};C:\Users\Administrator\Desktop\webpack.babelrc
C:\Users\Administrator\Desktop\webpack\package.json
C:\Users\Administrator\Desktop\webpack\src\index.js
C:\Users\Administrator\Desktop\webpack\src\math.js
Previous[WEBPACK] 2. Webpack : Khởi Tạo Project (nghiepuit)Next[WEBPACK] 4. Webpack : CSS Loader (nghiepuit)
Last updated