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 4

Preguntas 0

Ordenar por:

驴Quieres ver m谩s aportes, preguntas y respuestas de la comunidad?

o inicia sesi贸n.

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