@giphy/js-components Compiling to Javascript
See original GitHub issueI have a website that I have only used JavaScript with, but I tried using TypeScript as per the example on CodeSandbox. The problem I am having is that the browsers are not compiling the code correctly. Some of the errors I have encountered are:
“chat.ts” was blocked because of a disallowed MIME type (“video/mp2t”)” //chat.ts is basically the same code as index.ts in the CodeSandbox example
After installing TypeScript through npm and creating the js files I get this error:
“ReferenceError: exports is not defined” in chat.js (source of error: Object.defineProperty(exports, "__esModule", { value: true });
) This code was generated by running tsconfig.json in Visual Studio Code
I know how to program with TypeScript, but the problem is that I don’t know how to compile in the browser. I’ve tried researching this but had no luck. What am I missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
@maltoze it’s possible, just most people use a bundler and it hasn’t been on our roadmap. I’d have to add a
umd
file to our package.json and then it looks like you’d be able to use https://unpkg.com/ to grab the code in a script tagWhy doesn’t provide a version that can be used directly in
<script>
?