Custom Webpack configuration for JupyterLab prebuilt extension with special filename formatting

I’m trying to distribute jupyterlab-ihaskell as a prebuilt extension that is automatically installed by my Haskell package. I’ve been able to generate a prebuilt extension, but the output filenames contain more than one dot, which is a problem because of this silly bug that I can’t work around without dropping support for most of the older versions of GHC that I otherwise have no problem maintaining compatibility with. It looks like the JupyterLab configuration allows a custom Webpack config which is merged with the prebuilt config so I think that might be a viable way for me to control the output filenames so that they only have one dot, which would allow me to bundle the prebuilt extension with my Haskell package. I should mention that I already tried passing the --no-minimize and --dev-build flags when building my extension but they didn’t seem to have any effect.

tl;dr: can someone help me write a webpack config for my jupyterlab prebuilt extension that produces output filenames with only a single dot, for reasons ?

It’s a bit hard without some CI logs to look at with the list of the actual files generated to know what the offending files are…

Here’s one that disables minimization:

referenced from

Thanks, I’ll try something like that. My problem isn’t actually the minimization at all, it’s that the generated file names are something like remoteEntry.[hash].js or [number].[hash].js as you can see here. Cabal completely chokes on files that have more than one . in their filename to maintain compatibility with older versions of Cabal that have this behaviour, so I would like to change this to remoteEntry-[hash].js and [number]-[hash].js which would allow me to work around these issues.

I just tried it and your configuration correctly disabled minimization, which is a great first step, but what I really want is some way of changing the names provided here and here.

You could try something like:

I got this working but it involved writing my own webpack plugin. Here’s what I came up with, suggestions for improvement welcome! IHaskell/webpack.config.js at 98fbdf7e1cd9d8c54d4a91d1eaf6a4424550ff69 · gibiansky/IHaskell · GitHub