-
-
Notifications
You must be signed in to change notification settings - Fork 16
esbuild plugin support #23
Comments
What's the API you'd expect? |
I don't know tbh, but I would like to use a linaria plugin from here: https://github.com/callstack/linaria/blob/master/docs/BUNDLERS_INTEGRATION.md#esbuild |
Maybe there should be an 'esmo.config.js' |
It would be awesome! I use esbuild-node-loader for build ava tests, and, surprisingly, esbuild does not have its own config. I don't think I would have guessed to look at the configuration in the file // esbuild-loader.config.js
import linariaPlugin from '@linaria/esbuild';
import aliasPlugin from 'esbuild-plugin-alias';
export default {
plugins: [
aliasPlugin({
'imported-path': '/home/user/lib/src/resolved-path'
}),
linariaPlugin({
sourceMap: prod
}),
]
} |
This will be very helpful if we can reuse svelte ssr plugin here. Possible implementation: https://github.com/hyrious/esbuild-dev/blob/develop/src/loader.ts 1 I'm hesitant to add this feature now, since it will be really a lot of code to simulate plugin behavior in loaders mode. For example, you cannot just use I may never implement this feature in the end, because of my laziness. Footnotes |
@antfu Perhaps this could tie in with #30 (comment). As the new loader format exports a single export function createLoad(esbuildOptions) {
return (...loadArgs) => {
// implementation.
}
}
export const load = createLoad(); meaning you could point to your own custom loader with import { createLoad } from 'esbuild-node-loader';
export const load = createLoad({ customOption: true }); |
Hello,
I'd like to use
esbuild-node-loader
with Linaria but it requires to use a plugin for esbuild.Would be cool for this loader to support plugins (if it's possible)
The text was updated successfully, but these errors were encountered: