This will be the last pre-v1 minor release if all goes according to plan.
- Add support for
*.svelte.js
and*.svelte.ts
Svelte modules (Thank you @ElijahJohnson5 for the contribution!) - Remove support for boolean values for Svelte
css
compile option (useexternal
orinjected
instead) - Bump svelte minimum version to
4.2.1
- Bump esbuild minimum version to
0.17.0
- Bump Node minimum version to 18 (lowest supported by Svelte 5)
- Remove
overzealous
cache option (was unusable) - Remove
fromEntryFile
option (was unusable)
-
Update Svelte peer dependency version lock to include Svelte 5 pre-release versions (#235)
The version lock will be updated once Svelte 5 is released to remove support for pre-release versions. But for now, this should help prevent needing to use
--force
or--legacy-peer-deps
when using Svelte 5 pre-releases.
-
Update Svelte peer dependency version lock to include Svelte 5
This should have no impact on Svelte 3 or 4 users, but will allow folks to start trying out Svelte 5 if they so please. Any errors or issues should be reported as bugs in order to resolve them before Svelte 5 is offically released.
Plugin versions
v0.8.x
will be the last to support Svelte 3 and Svelte 4 belowv4.2.1
-
Minorly Breaking Caching is automatically enabled after two sucessful builds when using the
context
esbuild APIPreviously caching was automatically enabled when using the watch or incremental esbuild options, but those were removed in esbuild
v0.17.0
. This change brings back the automatic cache enabling when using thecontext
API which supports the same features as the previous watch and incremental options. esbuild does not provide a way for plugins to determine if thecontext
API is being used, so this feature is enabled after two successful builds. This should be a reasonable compromise between not enabling the cache at all and enabling it for every build (which wastes time and space if caching isn't needed).If you are using the
context
API and want to disable the cache, you can set thecache
option tofalse
in the plugin options but this isn't recommended (if you do need to disable the cache for some reason, please open an issue to see if your usecase can be fixed). -
Minorly Breaking Add dependency to
@jridgewell/trace-mapping
so error messages are more accurate when using preprocessors (#83)If you are using Svelte 4, this doesn't add additional dependencies because that package is already required by Svelte 4.
-
Update development esbuild version to
0.19.0
This means that this plugin now supports additional inhancements when using the
context
esbuildv0.17.0
API as detailed below.
- Lock Svelte peerDependency to
>=3.43.0 <5
to protect against breaking changes in future Svelte releases - Set compilerOptions.css to
external
by default if using Svelte v4 or higher (#185) - Add compatibility tests for different versions of Svelte and esbuild to prevent regressions
- Switch development version of Svelte to v4
- Switch from
.npmignore
tofiles
property ofpackage.json
to prevent accidental file inclusion
- Support string values for Svelte compiler option
css
added in Sveltev3.53.0
(#109, #150) - Update misc dependencies
-
Fix watch mode if preprocessing failed (#132)
-
Remove support for Node 12
This should probably be another breaking change however Node 12 has reached end of life and is no longer supported. If you are using Node 12, please upgrade to Node 14 in order to continue use of this plugin (or open an issue if you disagree).
-
Breaking Svelte has been switched to a peer dependency which allows Svelte to be updated independently of this plugin
Migration is as simple as
npm i --save-dev svelte
if you don't havesvelte
as a dependency already. -
Breaking Remove
compileOptions
since it was deprecated in v0.6.0
-
Add
filterWarnings
option to filter the Svelte warnings that esbuild-svelte passes to esbuild (Thanks @Prinzhorn)See
dist/index.d.ts
for the type definition of the new option. This hope is to replicateonwarn
from the Svelte Rollup plugin, but in a way that is more conducive to the way esbuild handles things.
-
Update Svelte to 3.46.2
-
(Unstable) Add "overzealous" cache mode that invalidates the cached version of a file if an imported Svelte component has changed (#102)
As with the standard caching system, this only applies in incremental or watch modes. This shouldn't be used in most situations, but if files aren't rebuilding when they are expected to, then this can be a helpful step before disabling the cache outright. I'm considering this an unstable feature because I'm not set on this way of doing it. This option may change in implementation, name and/or be removed at any time.
- Update Svelte to 3.45.0
- Auto create releases
- Rework and improve CI process
- Breaking: Switch
compileOptions
tocompilerOptions
to better reflect other bundler plugins (Thanks @tyler-boyd) - Add
include
option so the regex filter that selects compiled files can be changed (Thanks @tyler-boyd) - Fix "invalid character" error when using preprocessors and non-ASCII characters on NodeJS 15+. Upstream fix in progress (fixes #84)
-
Handle preprocessors when dealing with sourcemaps
This should result in more accurate sourcemaps when dealing with one or more preprocessors. Though this was already handled from a purely sourcemap symbols perspective, the sourceContents is now included which should make it easier to understand how the Svelte file was transformed.
-
Update Svelte to 3.44.0
- Emergency release to fix errors in distributed files
-
Return
resolveDir
for created css files so they can import content (#69) -
Update Svelte to 3.42.6
-
Add filtering to determine if the file to be processed is directly from esbuild
entryPoints
.This is in preparation for a feature that allows a binding to be automatically generated if a .svelte file is set as an entry point. The current configuration defaults to
false
in order to preserve current behavior, however the code is included for future expansion. Most all of my (and others) projects could be simplified once this is added, though I will preserve the current behavior for those that simply want to compile Svelte components using esbuild.
- Fix CSS sourcemaps which are now supported with esbuild v0.12.19 (#63)
- Update Svelte to 3.42.1
- Reduce number of development dependencies
-
Add dependency-aware caching for incremental builds that use a preprocessor (#59)
-
Report file dependencies to esbuild when using watch mode
Likely not something very many people ran into but svelte-esbuild now notifies esbuild of all preprocessor dependecies when watch mode is enabled. This means changes to one of those files will now trigger esbuild to rebuild, improving developer experience.
-
Disabled cache auto-enabling when using a preprocessor (better fix incoming)
This is pretty embarrassing and something I should have caught earlier (especially because the esbuild website specifically calls it out). I have a good idea about how to properly fix the issue (#59) but wanted to get a quick and dirty fix out there before others ran into it. This does affect rebuild performance if using preprocessors.
I don't consider disabling the auto-cache in certain scenarios to be a breaking change. The auto-enable cache feature is a progressive enhancement anyway so worst case performance degrades a bit while I get this fixed.
-
Improve testing (switched to
uvu
) -
Update Svelte to 3.38.3
- Update Svelte to 3.38.2 because of bugs in SSR updates
- Breaking: Require esbuild 0.9.6 or greater to support
initialOptions
property - Potentially Breaking: Auto-enable cache when build is in incremental mode or in watch mode
- Breaking: Remove
preprocessor
option, usepreprocess
instead - Update Svelte to 3.38.0
- Update Svelte to 3.35.0
- Update esbuild peer dependency to allow for 0.9.0 version
- Add JSDoc deprecation comment to
preprocessor
and add comments for other options - Fix error arising from esbuid release 0.8.51 and changes to import resolution (Thanks @AlexxNB!)
- Update dependencies
-
Deprecate
preprocessor
option in favor ofpreprocess
This is more in line with other bundler plugins which only use the
preprocess
option. This allows commonsvelte.config.js
configurations to be used without modification. Thepreprocessor
option is now deprecated, and will be removed with the next breaking release. -
(unstable) Add a cache for incremental and watch builds (#19)
This should speed up building large projects that use incremental esbuild builds or use the new
--watch
flag for esbuild. It is not required (or recommended) on normalbuild
ortransform
calls. To enable this feature, simply set thecache
option totrue
. This feature should be considered unstable until I get better test coverage. -
Update and fix example
-
Update and add more detail to README
-
Update Svelte to 3.32.1
-
Breaking Combine
esbuild-svelte/configurable
andesbuild-svelte
into one APIInstead whatever you were importing before, now just import
esbuild-svelte
and call it as a function to get the plugin.I've been wanting to do this for a long time (especially since #12) and it seemed like a decent time to sneak this in. I know this breaks builds (sorry about that), I'd rather get it over with now instead of down the line (once this hits
v1.0
). The author of esbuild has some significant code spliting changes incoming in the beginning of 2021, I'll likely bump this tov1.0
after that. -
Use TypeScript for development
-
Fix example to use
esbuild-svelte
import (npm link
is a useful command...)
- Fix sourcemap generation when exporting external css (#13)
- Update Svelte to 3.31.0
-
Fix path resolution for Windows when exporting css to external files (Thanks @markoboy)
This is already covered by tests (when running on Windows) but I'm not going to run CI on Windows. If it continues to be a problem, I will add explict tests but I don't see that becoming the case.
-
Add esbuild as peer dependency
-
Update Svelte to 3.29.7
-
(Breaking) Support separate CSS output stream
No more CSS in JS, yay! If for whatever reason this doesn't work, then just set the
css
compilerOption totrue
and it will revert to the previous behavior.In order to implement this, I created a fake file extension loader then set those files to be imported from the js code emited. A map acts as storage between the loaders. I'm not 100% happy with this system because it feels brittle and incomplete but it will work for now. If you have suggestions for how I could do this better, I am all ears!
- Fix preprocessor support, currently considered unstable until I test it with some of my personal projects
- Update README because I forgot that I added preprocessor support
- Add some simple smoke tests
- Add Github CI
- Add Dependabot
- Fix
configurable
so it actually works now (also add a bit of test coverage so it won't happen again) - Add typescript types to
configurable
preping for eventual conversion to typescript for development - Add .npmignore
- Format some files
- Update README to reflect the release of the plugin API
- Update to esbuild API version 0.8.1
- Add Svelte compiler configuration options
- Fix error/warning reporting from Svelte
- Add publishing workflow to reduce mistakes in the future
- Update example
- Correct module export
- Update README
- Actually export the plugin for use :)