Open rjcorwin opened 5 years ago
Ah, interesting... import * as jsQR from "jsqr";
works.
No wait, ok it imports something but not what we want.
Trying to build it from TS source I get...
➜ jsQR git:(master) ✗ tsc --target es6 --module es6
src/decoder/decoder.ts:3:49 - error TS2307: Cannot find module './decodeData'.
3 import { decode as decodeData, DecodedQR } from "./decodeData";
~~~~~~~~~~~~~~
src/decoder/decoder.ts:4:36 - error TS2307: Cannot find module './reedsolomon'.
4 import { decode as rsDecode } from "./reedsolomon";
~~~~~~~~~~~~~~~
src/index.ts:1:24 - error TS2307: Cannot find module './binarizer'.
1 import {binarize} from "./binarizer";
~~~~~~~~~~~~~
src/index.ts:3:22 - error TS2307: Cannot find module './decoder/decodeData'.
3 import {Chunks} from "./decoder/decodeData";
~~~~~~~~~~~~~~~~~~~~~~
src/index.ts:5:23 - error TS2307: Cannot find module './extractor'.
5 import {extract} from "./extractor";
~~~~~~~~~~~~~
src/index.ts:6:29 - error TS2307: Cannot find module './locator'.
6 import {locate, Point} from "./locator";
~~~~~~~~~~~
Found 6 errors.
I'm a n00b when it comes to configuring tsc
, I must be doing something wrong.
I'm importing this library into a Polyer 3 Web Component which uses rollup for module path resolution and expects the modules to be in ES 6 module standard. I see
dist/jsQR.js
useswebpackUniversalModuleDefinition
which sounds cool unless you're not in a Webpack setup :).