Skip to content

Relative path showing up in asset map? #29

@rebolyte

Description

@rebolyte

First off, this lib is exactly what I was looking for. Thanks for making it!

I am having an issue with a relative path showing up in the assets JSON file. Basically, I need the entry in the asset map to have a slightly different path from where the file gets output. I need the path to be stored as "js/bundle.{hash}.js" but the file output to "static/js/bundle.{hash}.js". This seems to be exactly what the --cwd option does, and it almost works, but then it creates an entry in the asset map like so:

{
  "../bundle.js": "js/bundle.b1e144c7.js"
}

I don't want the leading ../ on the filename. Where is it coming from? I could go through and strip it off after every build, but that seems hacky.

Here's the NPM script that I'm using:

"prod:js": "rollup --config | uglifyjs --compress --mangle --screw-ie8 | hashmark --cwd static --name bundle.js --silent --length 8 --asset-map ../data/assets.json \"js/{name}.{hash}{ext}\"",

Ideas? Let me know if you need any other info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions