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)"
},