No tienes acceso a esta clase

¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera

Setup con Webpack para el Chat en Tiempo Real con React.js

17/22
Recursos

Aportes 5

Preguntas 0

Ordenar por:

¿Quieres ver más aportes, preguntas y respuestas de la comunidad?

No me gusto, siento que le falta que contenido para lo largo que es el video.

f1 -> configurar fragmentos de codigo -> babel javascript


	"webpack production 19/jul/22 webpack.config.js": {
		"prefix": "webpp",
		"body": [
			"const path = require('path');",
			"const HtmlWebpackPlugin = require('html-webpack-plugin');",
			"const MiniCssExtractPlugin = require('mini-css-extract-plugin');",
			"const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');",
			"const { CleanWebpackPlugin } = require('clean-webpack-plugin');\n",
			"module.exports = {",
			"	entry: './src/index.js',",
			"	output: {",
			"		filename: 'bundle.js',",
			"		path: path.resolve(__dirname, 'dist'),",
			"		publicPath: '/'",
			"	},",
			"	resolve: {",
			"		extensions: ['.js', '.jsx']",
			"	},\n",
			"	mode: 'production',",
			"	module: {",
			"		rules: [",
			"			{",
			"				test: /\.(js|jsx)$/,",
			"				exclude: /node_modules/,",
			"				use: {",
			"					loader: 'babel-loader',",
			"					options: {",
			"						presets: ['@babel/preset-env', '@babel/preset-react']",
			"					},",
			"				}",
			"			},",
			"			{",
			"				test: /\.(png|jpg|gif|svg|jpeg|pdf)$/,",
			"				type: 'asset/resource',",
			"			},",
			"			{",
			"				test: /\.html$/,",
			"				use: { loader: 'html-loader', }",
			"			},",
			"			{",
			"				test: /\.css$/,",
			"				use: [",
			"					MiniCssExtractPlugin.loader,",
			"					{ loader: 'css-loader', }",
			"				]",
			"			},",
			"		]",
			"	},",
			"	plugins: [",
			"		new HtmlWebpackPlugin({",
			"			template: './public/index.html',",
			"			filename: './index.html'",
			"		}),",
			"		new MiniCssExtractPlugin({",
			"			filename: 'style.css',",
			"			chunkFilename: '[name].css'",
			"		}),",
			"		new CleanWebpackPlugin(),",
			"	],\n",
			"	optimization: {",
			"		minimize: true,",
			"		minimizer: [new CssMinimizerPlugin()]",
			"	}",
			"};",
		],
		"description": "webpack config 19/jul/22 (production)"
	},


f1 -> configurar fragmentos de codigo -> babel javascript

	"webpack development 19/jul/22 webpack.config.dev.js": {
		"prefix": "webpd",
		"body": [
			"const path = require('path');",
			"const HtmlWebpackPlugin = require('html-webpack-plugin');",
			"const MiniCssExtractPlugin = require('mini-css-extract-plugin');",
			"const { CleanWebpackPlugin } = require('clean-webpack-plugin');\n",
			"module.exports = {",
			"	entry: './src/index.js',",
			"	output: {",
			"		filename: 'bundle.js',",
			"		path: path.resolve(__dirname, 'dist'),",
			"		publicPath: '/'",
			"	},",
			"	resolve: {",
			"		extensions: ['.js', '.jsx']",
			"	},\n",
			"	mode: 'development',",
			"	module: {",
			"		rules: [",
			"			{",
			"				test: /\.(js|jsx)$/,",
			"				exclude: /node_modules/,",
			"				use: {",
			"					loader: 'babel-loader',",
			"					options: {",
			"						presets: ['@babel/preset-env', '@babel/preset-react']",
			"					},",
			"				}",
			"			},",
			"			{",
			"				test: /\.(png|jpg|gif|svg|jpeg|pdf)$/,",
			"				type: 'asset/resource',",
			"			},",
			"			{",
			"				test: /\.html$/,",
			"				use: { loader: 'html-loader', }",
			"			},",
			"			{",
			"				test: /\.css$/,",
			"				use: [",
			"					MiniCssExtractPlugin.loader,",
			"					{ loader: 'css-loader', }",
			"				]",
			"			},",
			"		]",
			"	},",
			"	plugins: [",
			"		new HtmlWebpackPlugin({",
			"			template: './public/index.html',",
			"			filename: './index.html'",
			"		}),",
			"		new MiniCssExtractPlugin({",
			"			filename: 'style.css',",
			"			chunkFilename: '[name].css'",
			"		}),",
			"		new CleanWebpackPlugin(),",
			"	],\n",
			"	devServer: {",
			"		static: {",
			"			directory: path.join(__dirname, 'dist')",
			"		},",
			"		port: 64340,",
			"		compress: true,",
			"		hot: true,",
			"		historyApiFallback: true,",
			"	}",
			"}",
		],
		"description": "webpack config 19/jul/22 (development)"
	},

😃 Buena nueva configuracion de webpack, de una vez para los snippets de codigo xD