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

Webpack Plugin Creation Watch Folder

I created a webpack plugin and would like it to be able to trigger a re-compile to my dist folder on changes in a folder, but I'm having trouble finding information on how to do it. I know it's possible because CopyWebpackPlugin triggers a…
David Torrey
  • 1,335
  • 3
  • 20
  • 43
1
vote
1 answer

Webpack vendor libs not splitted into separate bundle

I am trying to separate my vendor and app packages with the autodll-webpack-plugin (v0.4.2). this package is a top level plugin over the DllPlugin of webpack and the add-asset-html-webpack-plugin for auto-ordering the imports in the index.html.…
Mr.wiseguy
  • 4,092
  • 10
  • 35
  • 67
1
vote
2 answers

set variables by webpack.DefinePlugin from outer file - issues with async read

I have a two variables defined in the webpack.config.js file that I want to populate with values from outer file called Web.config. For this outer file I have an npm package called just webconfig to parse the variables and it works. File is parsed…
lkurylo
  • 1,621
  • 33
  • 59
1
vote
0 answers

Cannot statically analyse 'require(…, …)' while bundling coffeescript and backbone application using Webpack

I am trying to migrate from grunt to webpack in a backbone/coffeescript project. While bundling, I'm getting error Cannot statically analyse 'require(…, …)' for require statement in which dependencies are known at run time. To handle above, I'm…
1
vote
1 answer

Change Webpack entryPoint using Plugin

I'm writing Webpack Plugin and I need to do the same trick HotModuleReplacementPlugin does in order to inject webpack-hot-client before the app. It changes the entry-point of the bundle to be some custom function that requires…
felixmosh
  • 32,615
  • 9
  • 69
  • 88
1
vote
0 answers

Cannot use bluebird Promise IE11 webpack

I'm making an web app by using webpack, angularjs and bluebird. I put this in my code: { "plugins":[ { new webpack.ProvidePlugin({Promise: 'bluebird'}) } ] } But in developer console. Promise doesn't appear as a global variable.…
Redplane
  • 2,971
  • 4
  • 30
  • 59
1
vote
2 answers

Make webpack ignore a directory

I'm making a chrome extension that injects content scripts. I don't want Content scripts to be processed by webpack. My directory structure: /extension |-manifest.json |--scripts |- background.js |- content |-- script1.js |--…
1
vote
0 answers

Webpack multiple CSS outputs with ExtractText

I have a repo with multiple react components that need to work totally separated from each other, so every component has it's own output dir with the respective CSS, JS and HTML. To achieve this I iterate over an array with all the component names,…
1
vote
1 answer

What is this style of webpack syntax: imports?this=>global!exports?global.fetch

I am looking through a webpack config that contains the following code: new webpack.ProvidePlugin({ fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch', }), I see from the webpack docs that ProvidePlugin replaces the value on the left…
achalk
  • 3,229
  • 3
  • 17
  • 37
1
vote
0 answers

Create webpack plugin or loader to inject CSS file

I am writing a library with which you can render a React application as a web component. Like so: ReactWebComponent.create(, 'my-react-web-component', { css: 'inject' }); You can see there is an option { css: 'inject' }. To create a web…
Lukas
  • 9,752
  • 15
  • 76
  • 120
1
vote
1 answer

In Webpack, how to get multiple outputs with a single entry main.js(having multiple css files inside files)?

My directory structure should be like. |-src/ | |-styles/ (less) | | |-xx.less(input inside main.js) | | |-yy.less(input inside main.js) | | |-zz.less(input inside main.js) | |-dist/ |-assets/ | |-xx.css(output should be…
Rohit Gowda
  • 41
  • 13
1
vote
0 answers

Webpack handlebars-loader hangs website

I am trying to load handlebars-loaderenter code here, but my app hangs. It loads app.bundle.js but then not execute any futher scripts. There is no output in console. module.exports = { module: { loaders: [{ exclude:…
Michał Wojas
  • 509
  • 1
  • 5
  • 16
1
vote
1 answer

Webpack offline plugin how to add assets to sw.js

I'm trying to add webpack and offline-plugin to an existing project use gulp - webpack working just fine but adding offline-plugin is giving a hard time, what I did is adding the offline-plugin throw npm webpack.confing.js const {resolve} =…
user3853257
  • 43
  • 2
  • 11
0
votes
1 answer

I'm facing an error in a project using monaco editor. Error: Cannot find module 'metadata.js'

This is happening in a react project using webpack. The project is created using create-react-app After a lot of debugging, I have found the cause of the error to be in the following file. monaco-editor-webpack-plugin It happens in the function…
Atul Bhatt
  • 485
  • 1
  • 6
  • 15
0
votes
0 answers

Is there a way to modify module content after compilation in webpack5 plugin?

webpack5 plugin: i want to modify module content after compilation. modification of dependencies is not involved. my modifications need to be specified in the file and modified via the AST . how can i do ? i have tried module._source._value =…
1 2 3
8 9