Unable to load background image from Css file Webpack5

I’m trying to put an image as background in a div but it doesn’t recognize it because webpack changes the path to http://localhost:8080/gaia.png instead of http://localhost:8080/assets/images/gaia.png The image is displayed correctly inside an tag but it doesn’t load if I want to use it from the Css file. I’m sure the problem is the file… Read More Unable to load background image from Css file Webpack5

get webpacked module function variable

So, i have a function in file that converts into bundler.js via webpack (devtool: ‘eval-source-map’): function getTable(tname, trowid) { return get(ref(db, `table_name/${tname}/table_row_${String("0" + trowid).slice(-2)}`)).then((snapshot) => { if (snapshot.exists()) { console.log(snapshot.val()); // need to return this value } }); } window.getTable = getTable; and i need call this function in main.js smt like this: for (i… Read More get webpacked module function variable

What does the :8 mean in Webpack's output variables. filename: [name][contenthash:8]?

I’m configuring Webpacks output and i have run into some examples which have this unusual syntax added on the end. output: { filename: ‘[name][fullHash:8].bundle.js’, chunkFilename: ‘[name][fullHash:8].bundle.js’, path: `${__dirname}/dist`, publicPath: "/", }, Ok now you see the :8’s after fullhash? what extra feature does it provide? My first guess was UTF-8??? But that’s just a stab… Read More What does the :8 mean in Webpack's output variables. filename: [name][contenthash:8]?

how to write good anchors in react.js

I had code in react js but the are problem to write anchor with href . form example this below code import React from "react"; function Browser() { return ( <div> <section className="flex bg-gray-100 py-16 px-4" id="browse-the-room"> <div className="container mx-auto"> <div className="flex flex-start mb-4"> <h3 className="text-2xl capitalize font-semibold"> browse the room <br className="" /> that… Read More how to write good anchors in react.js

How can I translate the instructions/code that would work on the webpack.config.js to the vue.config.js file?

I’m using vue-cli which, instead of creating a webpack.config.js uses a vue.config.js: const { defineConfig } = require(‘@vue/cli-service’) module.exports = defineConfig({ transpileDependencies: true, }) as soon as Install a specific npm package Vue is trowing 17 errors: Vue Cli uses the latest version of webpack (5). But this new NPM package I’ve installed is only… Read More How can I translate the instructions/code that would work on the webpack.config.js to the vue.config.js file?

Module parse failed: Unexpected character '@' (1:0) – You may need an appropriate loader to handle this file type

When running npm start, webpack is throwing an error: ERROR in ./src/style/main.less 1:0 Module parse failed: Unexpected character ‘@’ (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders > @import "header.less"; | @color: #f5adad; | body { @ ./src/index.js 1:0-27 In… Read More Module parse failed: Unexpected character '@' (1:0) – You may need an appropriate loader to handle this file type

Webpack, css-minimizer-webpack-plugin vs mini-css-extract-plugin

I am always using mini-css-extract-plugin to optimize CSS. Today I found a new project, css-minimizer-webpack-plugin from here, seems like this project do the same thing as mini-css-extract-plugin. What is the advantage of css-minimizer-webpack-plugin? I read the docs and article from google, seems no one is talking about it? Should I use css-minimizer-webpack-plugin to replace the… Read More Webpack, css-minimizer-webpack-plugin vs mini-css-extract-plugin