1.2.7 • Published 1 year ago
atma-loader-ts v1.2.7
TypeScript Compiler (Atma Plugin)
- supports proper stacktrace line numbers
- supports custom
tstransformers
The Plugin extends:
IncludeJSwith a custom loaderatma-iowith a custom middleware to compile the TypeScript files on file readatma-serverandAtma Toolkitwith aHTTPHandlerto serve compiled sources (with sourceMap support)
Usage
Embed into the Project
npm i atma-loader-tsUpdate
package.jsonwith:{ "dependencies": { "atma-loader-ts" }, "atma": { "plugins": [ "atma-loader-ts" ], "settings": { "atma-loader-ts": { "extensions" : [ "ts" ], "typescript": { "compilerOptions": { // typescript compiler options }, // Optionaly transformers "transformers": { "before": ["foo"], "after": ["bar"] } } } } } }That's it. Now, you are ready to use TypeScript in your project
Quick Try
- install atma:
$ npm install atma -g - install plugin:
$ atma plugin install atma-loader-ts --save add
test.htmlto the directory<!DOCTYPE html> <script src='test.ts'></script>add
test.tsfunction log(msg: string) { console.log(msg.toUpperCase()); } setInterval(() => log('works'), 200);start the server:
$ atma server- open the browser:
http://localhost:5777/test.html
Transformers example
For the example, we will use nameof transformer: ts-nameof
- Install the transformer
npm install ts-nameof @types/ts-nameof --save-dev- Locate your
tsconfiguration and add to the root
{
"compilerOptions": {
},
"transformers": {
"before": ["ts-nameof"]
}
}The MIT License
1.2.7
1 year ago
1.2.6
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.1.20
3 years ago
1.1.19
3 years ago
1.1.18
4 years ago
1.1.17
4 years ago
1.1.16
4 years ago
1.1.15
4 years ago
1.1.14
4 years ago
1.1.12
6 years ago
1.1.11
7 years ago
1.1.9
7 years ago
1.1.7
7 years ago
1.1.6
7 years ago
1.1.5
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.0
9 years ago
