Category : webpack

When i try to use my svg as a background with relative path image background-image: url(‘./checkmark.svg’); webpack give me ‘can’t resolve’ error But absolute path is ok. background-image: url(C:UsersleoDesktopprojecthotelsrccomponentscheckbox-list__menucheckbox-list__checkboxcheckmark.svg); Actualy my config rules: module: { rules: [ { test: /.(?:ico|gif|png|jpg|jpeg)$/i, type: ‘asset/resource’, }, { test: /.scss$/, use: [MiniCssExtractPlugin.loader, ‘css-loader’, ‘sass-loader’] }, { test: /.(woff(2)?|eot|ttf|otf|svg)$/, type: ..

Read more

I’m using the DLL method to package the jQuery library but the browser keeps getting an error Here is my webpack.config.js file and webpack.dll.js file and index.js file const path = require(‘path’); const HtmlWebpackPlugin = require(‘html-webpack-plugin’); const webpack = require(‘webpack’); const AddAssetHtmlWebpackPlugin = require(‘add-asset-html-webpack-plugin’) module.exports = { entry: ‘./src/js/index.js’, output: { filename: ‘js/bundle.js’, path: path.resolve(__dirname, ..

Read more

I’m using the file-loader plugin, to load my images, well, all images are displayed correctly after the webpack build, but my SVG’s icons don’t appear on the page. The folder structure is correct, being the same for all images. And no type of error is returned const HtmlWebpackPlugin = require(‘html-webpack-plugin’); const MiniCssExtractPlugin = require(‘mini-css-extract-plugin’); const ..

Read more

Please find my webpack config below: const LinkTypePlugin = require(‘html-webpack-link-type-plugin’).HtmlWebpackLinkTypePlugin; const path = require(‘path’); const webpack = require(‘webpack’); const FileManagerPlugin = require(‘filemanager-webpack-plugin’); const { CleanWebpackPlugin } = require(‘clean-webpack-plugin’); const HtmlWebpackPlugin = require(‘html-webpack-plugin’); const UglifyJSPlugin = require(‘uglifyjs-webpack-plugin’); const MiniCssExtractPlugin = require(‘mini-css-extract-plugin’); module.exports = function(env) { const config = {}; config.entry = { ‘apps/xyz’: ‘./apps/xyz/index.js’, }; config.mode ..

Read more