First off: I am completely new to Node.js, so please bear over with me if this is a dumb question.
I am trying to get browserify and tsify to work with TypeScript and the SVG.js library. As far as I understand, I should be able to
- Write TypeScript code that uses the SVG.js library
- Compile this code to vanilla JS and bundle it together with the library itself for use in the browser using
browserifyandtsify
Step 1 is easy, but Step 2 is causing me problems. Even if I write the simplest of TypeScript programs containing only the line import * as SVGJS from 'svg.js', and then run the command specified in the tsify docs (browserify main.ts -p [ tsify --noImplicitAny ] > bundle.js), the compiled bundle.js file has the following contents:
Here, I was expecting to see the the code for the entire SVG.js library. At least that's what I get if I create a vanilla JS file containing var SVGJS = require('svg.js') and run browserify on that.
Can anybody tell me what I am doing wrong? I have installed all the required node modules, and am getting no warnings or errors during compilation. Please let me know if I need to provide more information.