question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to specify output folder name for @chialab/esbuild-plugin-html

See original GitHub issue

Hey, great plugin.

There’s just one issue for us, currently the exported folders are hardcoded to iife or esm. We need our assets folder to have a specific name, is it possible to offer an override for this?

So instead of dist/iife/index.js we can have dist/assets/index.js (plus same in the index.html also)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonwilliamscommented, Dec 29, 2021

So I have just faced an interesting issue while trying to import a PNG with the file loader. app.html being at the root of the out dir, my PNG was imported in ./iife/, but ESBuild would say the PNG is on ./placeholder.png instead of ./iife/placeholder.png, hence breaking the URI for the file.

Shouldn’t static assets be imported at the same level as app.html? We don’t need duplicate images for both builds.

edit: my config:

{
  ...
  loader: {
    '.eot': 'file',
    '.woff': 'file',
    '.woff2': 'file',
    '.svg': 'file',
    '.ttf': 'file',
    '.png': 'file',
  },
}

@martpie i think you’re describing a separate issue to what’s in this thread. It might be worth starting a new one to not muddy the waters here. Being able to rename the folders wouldn’t solve your problem

1reaction
edoardocavazzacommented, Dec 28, 2021

Hello @jasonwilliams!

The problem with a common output dir is that we are running two separate esbuild runs and there is the possibility that some chunks will be overridden. Anyway, we can add two plugin options, something like modulesOutdir and scriptsOutdir, and you can try to set the same value in here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the build output directory - Visual Studio (Windows)
Learn how you can specify the location of output generated by your project on a per-configuration basis (for debug, release, or both).
Read more >
How to choose directory name during untarring
This should work: mkdir pretty_name && tar xf ugly_name.tar -C pretty_name --strip-components 1. -C changes to the specified directory ...
Read more >
Changing the input and output directory in Vite - Stack Overflow
Create a vite.config.js file and define your project root and output directory as such: module.exports = { root: 'src', build: { outDir: '....
Read more >
-o (set Output directory) switch - 7-Zip
-o (set Output directory) switch. Specifies a destination directory where files are to be extracted. This switch can be used only with extraction...
Read more >
Folder Structure Settings | Altium Designer 23 User Manual
Output Name - select to use the output name as the output folder name. ... Setting the Custom Folder Name to =OutputName.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found