Replies: 1 comment
-
|
Stuff I tried:
I will be defaulting to runtime fetch but having this as a feature sounds good. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am bundling/building a small website and using typescript (so
parcel src/index.htmlwith<script src="index.ts">).When I try doing any variation of
import someData from './someData.json'(import or require) I get errorBrowser scripts cannot have imports or exports.and Parcel then helpfully provides the note aboutAdd the type="module" attribute to the <script> tag.Though I do not need module/import stuff, I am using imports only for JSON files.
Is there a way to get Parcel to import (inline) JSON without requiring module script tag?
I am aware I could just fetch it at runtime but bundling it is more practical.
Thanks for any pointers
Beta Was this translation helpful? Give feedback.
All reactions