I'm trying to set up a webpack config in a server enviroment that can output a bundle from a remote source. The source is a .js file and will be fetched through GET-requests. Is this possible?
Remote file - example.com/file.js
export default () => console.log('Hello world');
Webpack with pseudocode
const remoteSource = await fetchFromURL('http://example.com/file.js');
webpack({
entry: remoteSource,
output: {
filename: 'output.js',
path: path.resolve(__dirname, 'src'),
libraryTarget: "umd",
}
})
Any ideas are appreciated!