svelvet - 能够与Snowpack一起使用的cli编译器和监视程序
svelvet - 能够与Snowpack一起使用的cli编译器和监视程序 jakedeichert released this
Fixed
- Fix missing web_module check for dynamic imports #72
Assets
2
jakedeichert released this
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...
],
Assets
2
jakedeichert released this
Fixed
- Let babel know the absolute file path of the file currently being processed #61
Assets
2
jakedeichert released this
Fixed
- Upgrade snowpack to support 3rd party svelte files #48
Assets
2
Fixed
Assets
2
jakedeichert released this
Breaking Changes
- Auto delete dist directory on build #42
Assets
2
Assets
2
Watchers:9 |
Star:310 |
Fork:8 |
创建时间: 2020-01-19 04:47:11 |
最后Commits: 8月前 |
许可协议:MIT |
分类:其它杂项 / JavaScript开发 |
收录时间:2020-02-10 18:38:49 |
61f6f90
Compare
Added
--port <number>
#82