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
0
votes
1 answer

Change the chunk entry-module\deferred-modules of WebPack Chunk | Angular Builders WebPack Plugin

I'm writing an Angular Builder with some WebPack plugins and the issue I have is that my chunk after build including the self-execute sub-modules as following: ==> [[0, "runtime"]]]); (window["webpackJsonp"] = window["webpackJsonp"] ||…
John
  • 47
  • 1
  • 10
0
votes
1 answer

Webpack loader isn't called with sass local imports

I'm working on a webpack loader that should modify the content of a sass file in some way. the issue is that this loader isn't being called except when I import the sass file within JS so ✅ This will trigger a loader call File.js import…
Ibrahim Rahhal
  • 323
  • 2
  • 9
0
votes
1 answer

How can I wrap and concatenate js file with template file into one React Component?

Is there any webpack plugin or do I need to create my own plugin to solve this issue? I try to create react component by define OOP prototype way as below: Input: component.js Check if exist: component.html Then: try to concat component.js with…
0
votes
1 answer

Webpack 5 plugin: No code generation entry for module error

While upgrading a plugin I'm maintaining to support both Webpack 4 and 5 I've ran into the following brick wall for which I can't find any information at all and no one on Gitter seems to be able to help either. The plugin adds an asset (SVG…
Cas Cornelissen
  • 616
  • 8
  • 29
0
votes
0 answers

Can I use webpack.ProvidePlugin to add a reference to MicrosoftAjax.js?

I am just starting to try to figure out how to reference some external libraries using webpack.config.js. I need to reference the SharePoint libraries SP.js, SP.Runtime.js and SP.Taxonomy.js inside an Angular 8 application. The SP scripts call…
Newclique
  • 494
  • 3
  • 15
0
votes
1 answer

vue-loader interfering with custom plugin

To preprocess some custom non-HTML tags in a .vue file, I used to be (Webpack 3) able to install a loader via a plugin that would convert those custom tags into valid html/js code before the vue loader would see them and fail. apply(compiler) { …
orange
  • 7,755
  • 14
  • 75
  • 139
0
votes
1 answer

How to get a list of files in the bundle in webpack after treeshake

I am trying to get a list of files that end up in my build after treeshaking. I use conditional compilation constants to remove dev/debug code from bundle and Webpack is doing a good job with treeshaking, I don't find any dev code in the resulted…
0
votes
1 answer

Webpack - Copying Files In Development and Production

I wrote a plugin that does something similar to copy-webpack-plugin, but provides some extended functionalities that I need. Essentially it simply copies files from src to dist and performs some operations on them. It works fine when I run a…
Yoav Kadosh
  • 4,807
  • 4
  • 39
  • 56
0
votes
0 answers

How to debug chunk.isInitial() is not a function

I am updating to webpack@4.23, I ran in to this compilation error of TypeError: chunk.isInitial() is not a function in one of my custom webpack plugins, may be we need to update some syntax but basically what I want to know is how to debug webpack…
Shravya
  • 116
  • 1
  • 4
0
votes
1 answer

Unexpected and cryptic dotnet run "fail" messages with Webpack with HardSource on Vue.js site

When I start my Vue.js .NET Core project using dotnet run, I get the following "fail" messages, but the site seems to work fine. Anyone have an idea why I am getthing these messages and how to troubleshoot it? c:\myproj\Web>dotnet run Using launch…
Patrick Szalapski
  • 8,738
  • 11
  • 67
  • 129
0
votes
1 answer

Webpack 4 Plugin: Add module and get result from loader

I am making a Webpack 4 plugin for fun and to try to understand its internals. The idea is simple: Parse an HTML template file into a tree; Get the asset paths from and ; Add the assets to dependencies to load them…
Alexandre Borela
  • 1,576
  • 13
  • 21
0
votes
0 answers

Why is webpack's event listener hook called `plugin` and not something like `on`?

When creating a webpack plugin, the way one listens to lifecycle events is by calling compiler.plugin, like this example, which calls the callback function when the compile event is emitted; MyPlugin.prototype.apply = function(compiler) { …
CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
0
votes
1 answer

webpack plugin creation undefined options

I'm working on building a test webpack plugin. I have the following code: module.exports = class TestPlugin{ constructor(options){ this.options = options; } apply(compiler){ compiler.plugin("emit", function(){ …
David Torrey
  • 1,335
  • 3
  • 20
  • 43
0
votes
1 answer

Access Parser via Plugin in webpack-4

I'm working on a plugin for webpack version 4, and I'm trying to access the parser to do some pre-processing of input files, but I'm having a really hard time following the "documentation" of the new Tapable API and how I should be accessing the…
austinbruch
  • 323
  • 2
  • 14
0
votes
1 answer

Why is `window` undefined when running my Webpack plug-in after upgrading to Webpack 4?

I've written a plug-in for Webpack that takes my generated React component, renders it in Node, and then inserts it into the generated HTML document. This used to work fine in Webpack 3. To upgrade it to Webpack 4, I…
Vincent
  • 4,876
  • 3
  • 44
  • 55
1 2 3
8
9