⚡️ immediate page loads using pushState
Note: This project is in early development, and versioning is a little different. Read this for more details.
Why should you care?
npm install spike-pushstate -S
Just initialize it in your spike project as a plugin as such:
const PushState =moduleexports =// rest of your configplugins:
That will do it! By default it will match any file with a
.html extension, and use the pushState override on it. However, if you want it to match a different pattern, like maybe sugarml files instead, you can just pass a string with a glob matcher as such (string or array):
Note that all matches are made relative to the project root.
Because of an unfortunate webpack issue, you cannot use the globally installed spike CLI with this plugin. Instead, you must install spike locally (
npm i spike -S), then execute that version. Typically adding an npm script that runs
spike watchis the best approach.
This plugin will cause a crash if used with the source map option in your app.js file. Make sure the source map option is removed before running!
If you add a new file in development mode and are using webpack-hard-source for cacheing, you will need to clear your cache before the new page works with spike-pushstate.