Questions tagged [webpack-plugin]

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders" modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

132 questions
1
vote
2 answers

webpack-concat-text-plugin "node" is incompatible

The concat-text-webpack-plugin is nested deep in some package, and errors when I have NextJS and Node 18. error concat-text-webpack-plugin@0.2.1: The engine "node" is incompatible with this module. Expected version ">=8 <=16". Got "18.16.0" error…
Tobin
  • 1,698
  • 15
  • 24
1
vote
1 answer

Can Webpack plugin transform a file like loader?

I know that loaders are used to transform the module. But let's say I have a file that require a special process that can not be done by using loader. Can I develop a plugin to do that? I know Plugin can do many thing including adding new assets.…
Thelearning
  • 135
  • 1
  • 8
1
vote
0 answers

Dependency miss match error is throwing while npm install if I use `jsonpscriptsrc-webpack-plugin` npm package with gulp 4.0.2

If we try to npm install the jsonpscriptsrc-webpack-plugin npm package along with gulp 4.0.2 to override the jsonpScriptSrc method, we are facing the dependency mismatch issue. This issue is occurring only if we use the node version 15.0.0 to 15.7.0…
1
vote
1 answer

Why Multiple Remote federation module is not working for multiple remote child react app and a parent app?

ModuleFederationPlugin Webpack 5 Parent webpack configuration : publicPath: "http://localhost:3000/parentapp/", new ModuleFederationPlugin({ name: "parent", shared: { react: { requiredVersion:…
1
vote
0 answers

How to investigate vague "js/chunk-venders... from Terser" undefined failure?

My Vue-CLI project is failing to create a production build: ⠏ Building for production... ERROR Failed to compile with 1 errors 21:21:03 error…
Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
1
vote
0 answers

Webpack plugin parser hook doesn't tap for expression

I'm writing a plugin for webpack for extracting values from MyObject.myProperty = 'myValue'; expressions, and my hook doesn't tap for my expression. Here is the example code: var zzz = (function () { function zzz() { return this; } …
Tony
  • 5,797
  • 3
  • 26
  • 22
1
vote
0 answers

Webpack Loader: How to emit a single file after loader has run for every file?

Working on a Webpack loader that needs to transform source for each file and also emit a single file based on data from all those files. Looking at the webpack docs I wasn't quite sure if a loader can / should handle something like this or if a…
1
vote
0 answers

Create additional assets from a Webpack Plugin written in TypeScript

I want to generate a page based on the generated assets. So I created a Webpack plugin. import { readFile } from 'fs'; import webpack, { Plugin } from 'webpack'; import ejs from 'ejs'; interface Configuration { template: string; } interface…
Robin
  • 8,162
  • 7
  • 56
  • 101
1
vote
2 answers

Webpack/html-loader tag href resolve

I've set up aliases in my webpack config file. It works fine for JS, CSS imports and img src attributes. However I'd like to build a gallery in the HTML file with the standard lightbox setup:
csisy
  • 471
  • 3
  • 15
1
vote
1 answer

Force webpack-dev-server to reload

I am writing a plugin for webpack which starts good-fence in the background using EXECA. After the job is over I add errors to compilation.errors array. As execa runs in separate process errors added after the webpack compilation process finished.…
1
vote
1 answer

Make sure webpack plugin finishes before compilation

I'm trying to write a webpack plugin (my first! so bear with me please) that downloads fontello icon fonts, puts them in the dist folder and then generates an icons.scss file containing SASS variables for every icon. I guess this is a little…
powerbuoy
  • 12,460
  • 7
  • 48
  • 78
1
vote
1 answer

Custom Webpack plugin: Which hook for accessing transformed code

I'm trying to get the loader transformed content of files after a certain loader in a webpack plugin has done its job. This would usually be ideal for another loader, but I also need access to a hook that is called when the translation process is…
orange
  • 7,755
  • 14
  • 75
  • 139
1
vote
0 answers

control file not to generate a new dependency chunk on the top

I'm new to writing Webpack plugins. I want to add a new feature to an existing Webpack plugin repo. The feature is to resolve a sub-package's structure in a .json file, then the dependencies below the sub-package roots should be split from the main…
Gikono
  • 135
  • 9
1
vote
1 answer

Running optimize-js after Uglify in Webpack 4

Using Webpack 4, how can I run optimize-js after Webpack runs Uglify? It seems that in earlier versions of Webpack, you would use a plugin like optimize-js-plugin. I couldn't get this to work as Webpack appears to apply plugins before minifying…
1
vote
1 answer

Does Webpack DefinePlugin support variables or only constants?

I tries to pass an array to DefinePlugin . This array is declared globally and filled in by an another plugin (DirectoryTreePlugi, enhance method). But a browser's debuggers shows what the array is empty. If I assign some values to the array once I…
user1627760
1 2 3
8 9