I'm trying to get typescript and lodash to work in my app but when I run
tsc --module commonjs lodash-test.ts
Im always getting
lodash-test.ts(2,20): error TS2307: Cannot find module 'lodash'.
This still produces a lodash-test.js file
"use strict";
//lodash test that will be injected in index.html
var _ = require("lodash");
console.log('This is your lodash ts file');
console.info(_.chunk(['a', 'b', 'c', 'd'], 2));
Now when I run my index.html file in my browser, I'm getting
lodash-test.js:3 Uncaught ReferenceError: require is not defined
on line 3 of the file.
Index.html file
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script type="text/javascript" src="bower_components/lodash/dist/lodash.min.js"></script>
<script type="text/javascript" src="lodash-test.js"></script>
</head>
<body>
<h3>Hey</h3>
</body>
</html>
I have the lodash type definition in my typings folder. How can I make sure that Typescript can find this lodash/index.d.ts file? Also how can I fix the "require is not defined" error?
This is my file structure:
thanks for the help

d.tstypings file with a/// <reference path="" />command on top of your TypeScript file. Because for now,tschas now clue that you have typings files. So it can't find it. - Blackus