Skip to content

Metafile input and outputs relative to the current working directory #338

@matthewmueller

Description

@matthewmueller

I recently discovered the Metafile option which is very handy!

Problem

One issue I've run into is that the metafile's input and output paths are relative to the current working directory. In a build script, the current working directory can change. Sometimes, you're building from one directory, sometimes you're calling the script from another directory.

This makes it hard to consistently pinpoint the original files.

Here's an example:

{
  "inputs": {
    "../duo-blank/node_modules/svelte/internal/index.mjs": {
      "bytes": 51679,
      "imports": []
    },
    "../duo-blank/views/components/form.svelte": {
      "bytes": 3536,
      "imports": [
        {
          "path": "../duo-blank/node_modules/svelte/internal/index.mjs"
        }
      ]
    }
}

In this case I was building from another project.

Suggested Solution

Make the metafile's input and output paths relative to something that can be explicitly set. I'd probably say the Outdir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions