Closed ImmanuelSamuel closed 3 years ago
I'll ask @jakobrosenberg for some help on this one, Routify is his project and using https://github.com/roxiness/spank for SSG. Do mind this is an experimental project on integrating bleeding edge ViteJS and WindiCSS.
What does Vite's build output structure look like?
Thanks. Seeing as the script has a hash, the spank
config has to be a separate .js file.
This might work:
// spank.config.js
module.exports = {
entrypoint: "index.html",
outputDir: "dist",
inlineDynamicImports: true,
script: require('fs')
.readFileSync('./index.html', 'utf8')
.match(/<script .+?src="\/([^"]+)"/)[1]
}
yeah I had made those changes but the other imports do not work i.e., it looks for _layout.js in node_modules folder. @alesvaupotic do you have the same issue as well or is it only on my end.
Same issue, yes. Stand by for updates.
https://github.com/roxiness/spank/releases/tag/v1.6.0
No spank.config.js
required.
vite.config.js
needs to be updated:
build: {
polyfillDynamicImport: false,
cssCodeSplit: false,
...
},
resolve: {
dedupe: ['@roxi/routify'],
...
Fingers crossed. 🤞
Could you add SSG export for routify? I tried it but have issues with the modules not loading correctly (searches for modules in node_modules instead of dist/assets).