mmiller42 / html-webpack-externals-plugin

Webpack plugin that works alongside html-webpack-plugin to use pre-packaged vendor bundles.
MIT License
99 stars 16 forks source link

Usage for files outside node_modules? #43

Open andre-engelbrecht opened 5 years ago

andre-engelbrecht commented 5 years ago

Hi, is there a way to make this plug-in work for my own files, that are not in node_modules?

For example: I have some configuration data files in app/js/config/ I want these files to be excluded from all bundles, copied to the output (dist) folder and read from there at runtime, which is exactly what this plug-in does, but for files in node_modules.

I managed to get it to copy a test file and insert the script tag in index.html, but the contents of the test.js file is still bundled and read from there. Here's my experimental config:

new HtmlWebpackExternalsPlugin({ externals: [ { module: 'test', entry: '../../js/config/test.js', global: 'test', }, ], })

Any help will be greatly appreciated!

PierBover commented 5 years ago

Same problem here. We have a script that works at the global level that we import via a <script> tag and is obviously not available on NPM.