'Webpack + JS: Multiple outputs with one file

It it possible to make several outputs with one JS file, but different versions:

The main JS file should include different settings or extras:

Version 1:

import extras from './extras/john.js'

output: dist/main_john.js

Version 2:

import extras from './extras/susie.js'

output: dist/main_susie.js

and so on. It would be great if it would be possible, to compile different versions that way.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source