Giter Club home page Giter Club logo

Comments (2)

EMH333 avatar EMH333 commented on June 7, 2024

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.

EMH333 avatar EMH333 commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.