Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

v0.4.0

Compare
Choose a tag to compare
@jacobdeichert jacobdeichert released this 18 Mar 03:53
· 20 commits to master since this release

Breaking Changes

  • Use /public directory for static assets instead of copying from /src #65

Migration Guide for v0.3.x -> v0.4.0

See an example migration for the basic example project here.

New public directory for static assets

A 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>

New babel plugin for those that have a custom config

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...
],