Questions tagged [webpack-3]

Version 3 of the Webpack bundler. Webpack takes modules with dependencies and generates static assets representing those modules.

About

Released in June 2017. Migrating from Webpack 2 to 3 should involve no effort beyond running the upgrade commands in your terminal.

New Features

  • Scope Hoisting
  • Dynamic Import Syntax

Links

GitHub

183 questions
2
votes
1 answer

Custom errors for webpack: checking for env variables

I have a project compiled with webpack. There are separate dev & production builds, differentiated by the NODE_ENV environment variable. For the dev build, another env variable is required: REPO_PATH. Is there a way within webpack to check for the…
ebbishop
  • 1,833
  • 2
  • 20
  • 45
2
votes
0 answers

Disable inline stylesheets and separate them in files using webpack

Is there a config option in Vue to make a separate CSS file? I tried using the webpack plugin to extract CSS. However, Vue still loads the same styles inline. Is there something I’m missing about Vue? Or is this purely my misunderstanding of…
Douglas Choma
  • 163
  • 1
  • 2
  • 7
2
votes
0 answers

Exclude entry from webpack CommonsChunkPlugin

I have a multi-page website. Each page has its own entry point. I am using the CommonsChunkPlugin to extract shared libraries into a common js file that is included on all of my pages. I have one page that is different. This page runs some…
Brian Ball
  • 12,268
  • 3
  • 40
  • 51
2
votes
1 answer

How to reference Web Workers in production builds from webpack?

I am using a webpack template for Angular, provided by the angular starter seed at Angular Webpack Starter. This employs chunkhashing for production builds, (see webpack.prod.js). I have modified the webpack configuration to generated a separate…
dcs3spp
  • 493
  • 1
  • 9
  • 23
2
votes
0 answers

What is the different between require, require.resolve, webpack.ProvidePlugin and webpack.DefinePlugin

I'm doing a project using webpack, angularjs. In the webpack.config.js, I've seen sometimes they use: In app.js require('angular') In webpack.config.js new webpack.DefinePlugin({ 'require.specified': 'require.resolve' } In…
Redplane
  • 2,971
  • 4
  • 30
  • 59
2
votes
1 answer

jQuery Plugin method is not a function - Webpack, VS2017, ASP.NET Core 2.0

The code below works fine in VsCode + webpack Index.ts: require("./jQueryPlugin-No-Module"); debugger; $.fn.test(); // fails here I am using the ProvidePlugin to inject jQuery into this script file. jQueryPlugin-No-Module.js: (function ($) { …
Legends
  • 21,202
  • 16
  • 97
  • 123
2
votes
1 answer

Issue using extract-text-webpack-plugin

I am trying to use the Extract Text Webpack Plugin, but I have not been able to generate a new css file for the compiled sass files. webpack.config.js var ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry :…
Sachindra
  • 6,421
  • 6
  • 29
  • 38
2
votes
1 answer

Webpack incremental production build

I have a webpack project, which is built together with another components by SBT. The webpack production build compiles the src provides me with a dist folder, which is built from the src folder, and rest is copied assets. Each time I run the build…
user3712353
  • 3,931
  • 4
  • 19
  • 33
2
votes
0 answers

Why can't babel find its helper functions when compiling style changes with webpack in watch mode?

Having some issues with babel and webpack. I'm not sure what introduced this issue, Its been intermittent, happened a few days ago then went away after hours of trying to debug. I'm not sure what fixed it then. webpack.config --- relevant parts of…
Arlo Feirman
  • 95
  • 10
2
votes
1 answer

Webpack 3 not excluding node_modules

What's wrong with my webpack.config.js here, as it's failing to exclude node_modules. I've found similar posts about this issue with previous versions of webpack, but the fixes don't work as the syntax is different... module.exports = { …
user4893295
  • 533
  • 6
  • 25
2
votes
0 answers

Disable webpack watch temporarily

Is there a way to temporarily disable webpack's dev server watch? I have to restart the server almost every time after I run some modifying Git operation, e.g. checkout or rebase, because webpack recompilation usually fails with some random error. I…
DarkPatronusLinX
  • 397
  • 2
  • 11
2
votes
2 answers

Angular-CLI Code Coverage Issue

I have ejected my angular-cli project and cannot get any code coverage working. I have tried various packages and configurations and cannot seem to find the right combo. When I run npm run test the tests DO run successfully and shows the Chrome…
2
votes
1 answer

How to compiling styles in webpack

I have this modules in package.json { "name": "v1.0", "version": "1.0.0", "description": "", "main": "app-main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies":…
2
votes
0 answers

Webpack duplication

I'm working on a webpack configuration file and I feel like I'm either missing something basic or totally misunderstanding what I thought was the main feature of webpack. I've got a very basic webpack.config.js file that looks like…
Michael Tiller
  • 9,291
  • 3
  • 26
  • 41
2
votes
0 answers

Webpack not serving background image nested folder + images

I am using webpack(3.6.0) for an isomorphic react app and have everything working except the background image in my css file. All other styles work, the image is being output to my /dist folder as expected on my local machine, I see the correct file…