Skip to content

importmap pin --download does not work for multi-files dependencies #153

Open
@mildred

Description

@mildred

I need to have chart.js in my application, if I pin it without the download option, it works fine:

$ bin/importmap pin chart.js
Pinning "chart.js" to https://ga.jspm.io/npm:[email protected]/dist/chart.mjs

It will load the following URLs at runtime:

However, if I run:

$ bin/importmap pin --download chart.js
Pinning "chart.js" to vendor/javascript/chart.js.js via download from https://ga.jspm.io/npm:[email protected]/dist/chart.mjs

It does not work because dependent files are not downloaded. I get the following exception in rails:

Asset `chart.js/dist/Chart.js` was not declared to be precompiled in production.
Declare links to your assets in `app/assets/config/manifest.js`.
  //= link chart.js/dist/Chart.js
and restart your server

However, I'd still like to serve the dependency locally

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