Skip to content

Commit 97d5428

Browse files
committed
started converting over to TS
1 parent e9c7042 commit 97d5428

7 files changed

Lines changed: 52 additions & 7 deletions

File tree

‎v5-unity/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2+
typings/
23
*.bundle.*
34
# ignore *.png only in this directory
45
/*.png

‎v5-unity/README.txt‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,23 @@ and run the server with Bottle:
3333
python bottle_server.py
3434

3535

36-
# to start using npm:
37-
npm start
38-
npm run webpack
36+
to start using npm:
37+
38+
npm start
39+
npm run webpack
40+
41+
---
42+
For developing using TypeScript:
43+
sudo npm install -g typescript # install globally
44+
npm link typescript # link to the local node_modules/ dir
45+
npm install tsd -g # tsd type definitions manager
46+
tsd install require --save
47+
tsd install jQuery --save
48+
tsd install jquery.bbq --save
49+
[then in the future, run 'tsd install' to install definition modules
50+
saved in tsd.json]
51+
52+
Currenly using: Version 1.8.10
3953

4054
---
4155

‎v5-unity/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"css-loader" : "",
1616
"style-loader" : "",
1717
"url-loader" : "",
18-
"script-loader" : ""
18+
"script-loader" : "",
19+
"ts-loader" : ""
1920
}
2021
}

‎v5-unity/tsconfig.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"sourceMap": true
5+
},
6+
"exclude": [
7+
"node_modules",
8+
"example-code"
9+
]
10+
}

‎v5-unity/tsd.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "v4",
3+
"repo": "borisyankov/DefinitelyTyped",
4+
"ref": "master",
5+
"path": "typings",
6+
"bundle": "typings/tsd.d.ts",
7+
"installed": {
8+
"requirejs/require.d.ts": {
9+
"commit": "1315d46f8066eec8c197914da88e98629ebc2254"
10+
},
11+
"jquery/jquery.d.ts": {
12+
"commit": "1315d46f8066eec8c197914da88e98629ebc2254"
13+
},
14+
"jquery.bbq/jquery.bbq.d.ts": {
15+
"commit": "1315d46f8066eec8c197914da88e98629ebc2254"
16+
}
17+
}
18+
}

‎v5-unity/webpack.config.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828
entry: {
2929
'opt-frontend': "./js/opt-frontend.js",
3030
'opt-live': "./js/opt-live.js",
31-
'iframe-embed': "./js/iframe-embed.js",
31+
'iframe-embed': "./js/iframe-embed.ts",
3232
},
3333

3434
output: {
@@ -44,8 +44,9 @@ module.exports = {
4444

4545
module: {
4646
loaders: [
47-
{ test: /\.css$/, loader: "style!css" },
48-
{ test: /\.(png|jpg)$/, loader: 'url-loader' }
47+
{ test: /\.css$/, loader: "style!css" }, // CSS
48+
{ test: /\.(png|jpg)$/, loader: 'url-loader' }, // images
49+
{ test: /\.ts$/, loader: 'ts-loader' } // TypeScript
4950
]
5051
},
5152

0 commit comments

Comments
 (0)