ssg
ssg copied to clipboard
Broken links to css and js
Followed all steps detailed in README.md
The generated static content references: build/assets/*
...for css and js files, but this folder does not exist.
css and js files do exist in: css/* js/*
...but have different names to those referenced in the html. Example: html ref: tailwind-891c0160.css filenames in css:
- tailwind.css
- tailwind.css.br
- tailwind.css.gz
Any ideas?
For now, to work around, I've done this (in case it helps others):
In layouts.antlers.html:
Remove Antlers:
{{ vite src=“resources/js/app.js|resources/css/app.css” }
Add HTML:
<link rel="stylesheet" href="/css/tailwind.css"/>
<script src="/js/site.js"></script>
<script defer src="//unpkg.com/alpinejs" defer></script>
You probably need to update the copy paths in your ssg.php config file:
'copy' => [
public_path('assets') => 'assets',
- public_path('css') => 'css',
- public_path('js') => 'js',
+ public_path('build') => 'build',
],