-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Description
I started my app with Sprockets and replaced it with Propshaft. I now have a problem adding to trestle/custom.js.
I can see there is the possibility to add javascripts through the hooks but that would require me to add the hook on every page.
I'm using javascript_bundling with esbuild.
- I've added
trestle/custom.jsto excluded_paths,Rails.application.config.assets.excluded_paths += %w[app/assets/javascripts/trestle/custom.js]
- added
app/assets/javascripts/custom-esm.jswith my custom javascript to be included- import 'path/to/import`
- I esbuild this and output it to trestle/custom.js
"build:js": "esbuild app/assets/javascripts/trestle/custom-esm.js --bundle --sourcemap --format=esm --outfile=app/assets/builds/trestle/custom.js --public-path=/assets"
esbuild will build my custom-esm.js and puts it in the place where Trestle expects the custom.js to be with the name custom.js.
This seems to work for me.
Great library btw, thanks for all your work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels