Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

Usage for files outside node_modules? #43

Open
andre-engelbrecht opened this issue Feb 4, 2019 · 1 comment
Open

Usage for files outside node_modules? #43

andre-engelbrecht opened this issue Feb 4, 2019 · 1 comment

Comments

@andre-engelbrecht
Copy link

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
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants