Convert Vite React project to Webpack for bundler | Hindi

preview_player
Показать описание
Checkout My Other Videos :-

Checkout My Playlist :-

Vite To Webpack conversion.

Copy below code :-

import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';

export default {
output: {
},
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
}
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'] // Add CSS loader
}
]
},
plugins: [
new HtmlWebpackPlugin({
})
],
devServer: {
static: {
},
compress: true,
port: 9000,
open: true
}};

2. Install related dependencies :

npm install webpack webpack-cli webpack-dev-server babel-loader @babel/core @babel/preset-env @babel/preset-react html-webpack-plugin style-loader css-loader —save-dev

"start": "webpack serve --mode development --open",
"build": "webpack --mode production"
Рекомендации по теме
Комментарии
Автор

Hello bro,
Can you create a video on how to optimise ( like remove unused css and js using webpack) a normal php website which has some pages.

doedits