New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong dir resolvepath #2
Comments
I'm getting something similar. With a baseDir of
the file ends up being placed in:
Based on the documentation, I would expect this to be dropped into |
Is {"hash": true} |
Ah, no, but even in that case your example shows an import of ‘/path/to/file.png’ with a distributed path of just ‘/static/file.png’ I was not expecting this to copy my entire folder structure to /static - I’d argue the primary use case would be to not copy the entire dir structure and expose that to the world. If the asset is automatically moved and the src references the correct path, I shouldn’t care if your plugin puts 104837 assets in the root of my /static folder |
It should copy entire directory structure to prevent file name conflict, |
👍👍 |
in my situation i don't set next folder at the root path.
here is my project path example
approot
--app
----next
------components
--------login
----------img
------------a.jpg
----------login.js
------static
------pages
------styles
My babelrc:
{ "plugins": [ [ "import-static-files", { "baseDir": "app/next/static/", "baseUri": "http://your.cdn.address" } ] ] }
i build this project at the root path
next build app/next
i get img path in login.js like this
import logoImg from './img/a.jpg'
then i'll get the result
var logoImg ='http://your.cdn.address/app/next/static/app/next/components/login/logo/img/a.jpg';
it's absolutely wrong,how can i fix it?
The text was updated successfully, but these errors were encountered: