Comments (2)
Good question... Essentially all the null
does right now is initialize everything with defaults. The idea was that someone could do something like import esbuildSvelte from 'esbuild-svelte'
and treat esbuildSvelte
as a variable instead of a function. Essentially trying to keep things as "simple" as possible.
However, as I am looking at what other plugins are doing, and how much confusion this actually ends up adding, I will probably remove that functionality in v1 so there will be one import in the future.
Essentially
import sveltePlugin from 'esbuild-svelte';
import { build } from 'esbuild';
build({
...
plugins: [sveltePlugin()]
});
for simple cases and
build({
...
plugins: [sveltePlugin({
compileOptions: {
legacy: true,
dev: true,
},
preprocessor: anExamplePreprocessor
})]
});
for more complex cases will work from the same import.
This will be a breaking change, but one that makes a lot of sense in my mind. I haven't had the time to move everything over yet. I've been watching the esbuild repo and will probably to the update after Evan Wallace releases the next evolution of changes to the plugin api.
Wow, that was an extended answer to a simple question, sorry about that :)
TL;DR: Cluelessness on my part for the best way to keep things simple
from esbuild-svelte.
FYI, I've released v0.4.0
which unites everything under one import (which then must be called a function, regardless of advanced options or not). Hopefully this *actually* simplifies things?
I'll close this issue b/c it is no longer relevant to the current code state, please re-open if I'm missing something
from esbuild-svelte.
Related Issues (20)
- Problems getting Svelte components' internal CSS styles HOT 3
- esbuild-svelte breaks watch mode on error HOT 2
- Make Svelte a peer dependency HOT 2
- dev-mode does not seem to be enabled HOT 1
- Unexpected token HOT 2
- Generate output HTML HOT 2
- cssOutputFilename not working HOT 2
- Breaks watch mode on error when preprocess dependency transformation fails HOT 5
- Example use with Typescript HOT 4
- how combine with esbuild-coffeescript ? HOT 1
- svelte: 3.53.0 ▲ [WARNING] [plugin esbuild-svelte] options.css as a boolean is deprecated. Use 'external' instead of false. HOT 2
- Option to enable svelte-check? HOT 2
- External Svelte module errors when using a Svelte import HOT 3
- Unexpected token error with latest svelte-preprocess v5 HOT 2
- Updating examples to use the 0.17.x esbuild "context API"? HOT 3
- svelte@4 - compilerOptions.css as a boolean is deprecated HOT 3
- compilerOptions css does not bundle external css files HOT 1
- Add `svelte` condition automatically
- customElement option throws an error HOT 2
- Release plugin version 1.0.0 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild-svelte.