Can we have assets in a separate directory to the main html file?
See original GitHub issueSo my previous webpack config would generate something which looked like this. html-webpack-plugin
public
├── index.html
└── ui-assets
├── assets-manifest.json
├── main.d2fe0910b8.js
├── main.d2fe0910b8.js.map
├── vendor.67dfc8f6a1.js
└── vendor.67dfc8f6a1.js.map
This was useful to us because we didn’t want the main entry point (index.html) to be hashed. it also allowed us to serve static assets from a different place.
@chialab/esbuild-plugin-html@0.15.0
generates this:
public
├── 1-25MTWOSN.js
├── 1-25MTWOSN.js.map
├── 1-LCOOVKTY.css
├── 1-LCOOVKTY.css.map
└── index-LJMJ3LED.html
We don’t want the main entry point hashed, and we would like the assets (JS and css files) to be in a separate directory.
Is this possible for you to implement?
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Dealing with files - Learn web development | MDN
When you are working on a website locally on your computer, you should keep all the related files in a single folder that...
Read more >How to set files inside the assets folder in index.html
For directory structure : use single dot(.) for current directory; use double dots(..) jump out the current directory.
Read more >Manage Files & Folders in HTML Project Properly - YouTube
This assets management guide is for static HTML websites. For other frontend/backend framewroks like ReactJS, AngularJS, WordPress or ...
Read more >How to make html files output to a different directory · Issue #665
Goal: Have sub-folders with index.html that can reference the assets using relative path. Reason: On S3 I want to have multiple websites in...
Read more >Adding an assets directory to GitHub Pages | The Least You ...
Adding an assets directory to GitHub Pages. GitHub Pages is based on Jekyll, which expects graphic images and custom CSS to be in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oops, I forgot a console.log, removed in 0.15.4.
I hadn’t see before that your assets were CSS and JS files. Those files are considered chunks by esbuild, not assets. You have to set
chunkNames: 'assets/[name]-[hash]'
too.Hey @edoardocavazza I just noticed in watch mode (not serve), its generating new assets but the html file isn’t being updated to point to the new ones. I think this may be a bug