Skip to content

reference static assets doesn't work #108

@g13ydson

Description

@g13ydson

About PR #58 @, I would like to use Esbuild for all our static assets instead of using a different solution for images.
I tried what is in the README, but it also generates .js/.css files in the output directory.

our script:

package.json

"scripts": {
  "build:js": "esbuild app/javascript/*.* --bundle --loader:.png=file --outdir=app/assets/builds/ --public-path=assets",
  "build:css": "sass app/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
}

javascript/application.js

// Entry point for the build script in your package.json
import "@hotwired/turbo-rails"
import "./controllers"
import * as bootstrap from "bootstrap"

There is an image in: javascript/images/logo.png

Is there a step I'm missing so that the image is copied to the output directory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions