title: How to access local json file via svelte?
body: <p>For now I use onMount async function to access</p>
  
  <pre><code>const dataAPI = './jsfwperf.json';
  let data = [];
  
  onMount(async () =&gt; {
      const res = await fetch(dataAPI)
      .then(res =&gt; res.json())
      .then(data =&gt; {
          console.log(data)
      })
      .catch(err =&gt; console.error(err));
  });
  </code></pre>
  
  <p>But in terminal it shows that file is missing</p>
  
  <pre><code>bundles src/main.js → public\build\bundle.js...
  [!] Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
  </code></pre>
  
  <p>File location is the same as app.svelte that I used.
  How can I proper access local json file via svelte?</p>