2

How to inject my dll.bundle.js to index.html file?

In chrome console, it throws an error:

Uncaught ReferenceError: vendor is not definedandUncaught TypeError: webpack_require(...) is not a function error.

It's because of my Dll does not inject to index.html file

I don't want to use express or node server to host my static file. I just want to use webpack-dev-server. How can I do that with Dll bundle?

Lin Du
  • 88,126
  • 95
  • 281
  • 483

1 Answers1

0

Well, your DLL bundle is generally built in Webpack as well, as the documentation explains:

Image showing DllRererencePlugin Usage from Webpack Docs

You are ultimately responsible for providing the file. You could simply inline it in your index.html as an inline script: <script> //paste file here contents here </script>.

Otherwise it is pretty typical to let express serve the files statically in development (CDN in production). This stack overflow answer provides a good example of usage/setup.

adamrights
  • 1,701
  • 1
  • 11
  • 27