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
can't add assets #36
Comments
I use like this |
@artemsoliar In this scenario webpack doesn't add the image to the generated output public folder and I have 404 errors. I'm using the bare
|
in webpack.config.js file add like this
|
@artimSoliar thanks, that helped. Not an ideal solution but good enough. |
You can also add folders path to copy directories: https://github.com/ng-seed/universal/blob/master/config/webpack.config.js#L26 |
@ahmed-anas, @artemsoliar, @theomathieubhvr done 👍 |
I'm submitting a ...
Current behavior
adding
<img src="assets/pic.jpg" />
toapp.component.html
(and a pic.jpg in the assets folder) gives the error:Can't resolve './assets/pic.jpg'
changing the path of the asset to relative, i.e making it
<img src="../assets/pic.jpg" />
gives the error:Error: Path variable [chunkhash] not implemented in this context: assets/pic.[chunkhash].jpg
. Assets should not be relative so adding the../
shouldn't work in any case.I run using:
npm run build:universal-prod; npm run serve;
Expected/desired behavior
It should work. Or perhaps this is configured to work with different sort of paths? If so, please advice.
Please tell us about your environment:
Windows 10
Browser: all
**Quick Solution: ** changing
chunkhash
tohash
in thewebpack.common.js
file seems to fix this error though I'm not sure what complications that might have. Although the path would need to be relative to the current location, and ideally we should just be able to doassets/pic.jpg
or something of the sort.The text was updated successfully, but these errors were encountered: