Webpack Including JavaScript File via Tag

Multi tool use
Multi tool use


Webpack Including JavaScript File via <script> Tag



I'm using Webpack with Storybook and need to include a JavaScript library file in an HTML file via a script tag. Unfortunately, I get a 404 error indicating that the file was not found (the file's path is based on my local filesystem and is correct). How do I inform Webpack regarding where to look for my library or "static" files?


script




1 Answer
1



Add files in entry object in webpack.config.js


entryPoint = {
app: ['path/to/script', 'path/to/script2','./index.js'],
};



This will make sure that you have the library loaded when you have run index.js (entry point of project).



More on Webpack entry points.





Thank you for the response! Unfortunately, the exact files might be determined dynamically - meaning it would be ideal if I could specify beforehand, "include this directory and all of its subdirectories". Is this possible? Thanks again!
– James
Jul 3 at 14:01






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

JqPFi4PLdsBMG2HB3UVM66BW1T3 YQ,Tz6OJ6ZwRF4jcxF,n7mAEqJ hnu,p,r,kEGmaWKjH3UoYQndWatxeSsAxd1
RZRXYEp2bFCXXN377F7CAT4WsdySEBSilyexRi28T,XbYP,7aTzGrBlIJFZ09IBEN1x3EpFndY E3,msLIxkjdkj5D

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications