? An experimental svelte compiler & watcher that works with snowpack
See an example migration for the basic example project here.
public
directory for static assetsA new ./public
directory is required for static assets. All non-js and non-svelte files inside ./src
must be moved to ./public
. Svelvet no longer copies files over from ./src
except for js and svelte files which are processed first.
Svelvet no longer compiles to ./dist
. We now build your svelte and js files to ./public/dist
.
Instead of deploying the ./public/dist
directory, you need to deploy the entire ./public
directory.
You also must update your script entrypoint inside your html files to point to the new location.
<!-- BEFORE -->
<script type="module">
import App from './App.js';
new App({
target: document.querySelector('#app'),
});
</script>
<!-- AFTER -->
<script type="module">
import App from './dist/App.js';
new App({
target: document.querySelector('#app'),
});
</script>
If you have chosen to use a custom babel.config.js
, you must change the snowpack plugin to a new svelvet plugin instead.
// BEFORE
plugins: [
// You can override the babel config but you must have this plugin defined.
[
'snowpack/assets/babel-plugin.js',
{
// Append .js to all src file imports
optionalExtensions: true,
importMap: '../dist/web_modules/import-map.json',
},
],
// Your plugins...
],
// AFTER
plugins: [
'svelvet/plugins/babel.js',
// Your plugins...
],