This issue is a:
(using nwb v0.15.8)
Hello,
I'm new with nwb and, first off, great job, it's a great experience creating packages !
I'm trying to make a sandbox for a library of react components. My components will use css and js files that are in other packages, and that I will load with
nwb uses https://github.com/kevlened/copy-webpack-plugin to copy the contents of public/ to the output folder, which adds the files to be copied to Webpack's in-memory filesystem, which is what's being served by by webpack-dev-middleware when you run the dev server.
As such, anything in public/ should be available under / when running the dev server, so try /my-static-script.js.
Thanks for your very quick reply ! however, this does not sem to work over here
my html file looks like this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="/my-static-script.js"></script>
</head>
<body>
<div id="demo"></div>
</body>
</html>
Does the copy of public/ happen the same way for components and apps created with nwb ?
Is there anything specific to add to nwb.config.js to enable it ?
Where should public/ be located:
/public/,/demo/public/,/demo/src/public/ ?The public folder is copied in demo/dist/ in build-demo.js
but it does not seem to do it in serve-react-demo
maybe I missed something
I've just spotted that we're not creating the CopyPlugin config for serving the demo, only when building it.
I can add this to the next branch, which will be almost ready for release when I finish updating outdated dependencies.
great, thanks :) !