module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

How to reference a JSON file in a component?

Open timb-103 opened this issue 10 months ago • 1 comments

I'm trying to import a JSON file in a vue component, this is how I do it current in a non-module build:

import List from "~/src/json/list.json"

I've tried adding the json file to assets in the runtime folder, but can't figure it out.

timb-103 avatar Jul 28 '23 03:07 timb-103

Could you provide a reproduction that shows what you are doing? If it and the Vue components are both in the runtime directory, I would use a relative import.

danielroe avatar Jul 28 '23 06:07 danielroe