I\'m trying to use export and import but it not working I get an error
Here is my code HTML :
<
try the following changes
HTML:
@RenderBody()
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"outFile": "~/scripts/main.js",
"lib": [
"dom",
"es2015",
"es5",
"es6"
]
}
}
with this config your output is only one js file what can be uglified wunderfull, containing all referenced files in the main.ts. i just don't know if ~/ works or if you have to set the path relative to the config file, i'm not working with linux.
User.ts
class User {
firstName: string;
lastName: string;
}
Main.ts:
///
// import { User } from "./user"; // not needed if referenced
console.log(new User());
all reference declarations have to be written at the beginning of the file