Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[esbuild-renderer] static files #13

Open
usaccounts opened this issue May 6, 2021 · 6 comments
Open

[esbuild-renderer] static files #13

usaccounts opened this issue May 6, 2021 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@usaccounts
Copy link

usaccounts commented May 6, 2021

Need to be able to import js files in html - cannot do that because source is a bundle - a single js file. One should be able to import static js files - perhaps a static directory would be useful and served by the proxy. Or have a way to create multiple bundles.

@usaccounts
Copy link
Author

Also css.

@Kiyozz
Copy link
Owner

Kiyozz commented May 12, 2021

  • For webpack, dev-server allow static files
  • For esbuild, I'll need to do something myself
  • For vite, dev server allow static files.

This will come in next releases

@josteph
Copy link
Contributor

josteph commented May 24, 2021

I have been trying to use WebWorker but it seems this feature needs to be supported internally first.
On 2nd thought, this is a little bit different than what the OP was asking.

@Kiyozz Kiyozz changed the title Import js files [esbuild-renderer] static files May 25, 2021
@Kiyozz Kiyozz added the enhancement New feature or request label May 25, 2021
@Kiyozz Kiyozz added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 6, 2021
@Kiyozz
Copy link
Owner

Kiyozz commented Jul 6, 2021

I haven't found the time to work on this issue. Helps are welcome!

@trebconnell
Copy link

trebconnell commented Jul 14, 2021

I'm still ramping up to esbuild, but could esbuild external option be used? Or potentially the same way preload.js is done in the main-ts template, making the js a separate entry point and then referencing it by path?

@eduardoleolim
Copy link

eduardoleolim commented Jul 5, 2023

You could add support for an optional path-option for static files in the yaml renderer-config or reuse output.dir and then use one of them in esbuild.builder as servedir property in ctx.serve() (line 106)

ctx
    .serve({
        host,
        port,
        servedir: path.resolve(this._config.fileConfig.staticPath or this._config.fileConfig.output.dir),
    })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants