jordankaiser
11/15/2019 - 4:52 PM

Webpack

Webpack

Using Multiple webpack setups on the same project.

For example on a Drupal project you might have webpack setup in the them folder and in a number of custom module folders.

Since webpack by default attaches it's stuff to window.webpackJsonp you'll run into issues if you don't change that for each of you diffent setups. Otherwise they will all try and output to it.

To resolve you can specify a custom output namespace in webpack.config.js like so:

output: {
  jsonpFunction: 'webpackReferenceFieldEnhancementsJsonP',
},

Reference - output.jsonpFunction