Skip to content

Commit 5d3cc84

Browse files
committed
webpack and tsconfig
1 parent d0aa9ba commit 5d3cc84

File tree

6 files changed

+3933
-3
lines changed

6 files changed

+3933
-3
lines changed

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
</head>
77
<body>
88
<div class="app"></div>
9-
<script src="dist/app.js"></script>
9+
<script src="/app.js"></script>
1010
</body>
1111
</html>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
"url": "https://github.com/UltimateAngular/typescript-basics-seed/issues"
2525
},
2626
"homepage": "https://github.com/UltimateAngular/typescript-basics-seed#readme"
27-
}
27+
}

src/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
console.log('Hello TypeScript!');
1+
console.log('perror TypeScript!');

tsconfig.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs",
5+
"strict": true,
6+
"outDir": "dist"
7+
}
8+
}

webpack.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
entry: './src/app.ts',
3+
output: {
4+
filename: 'app.js',
5+
path: __dirname + './dist',
6+
},
7+
resolve: {
8+
extensions: ['.ts', '.js'],
9+
},
10+
module: {
11+
rules: [{ test: /\.ts$/, use: 'awesome-typescript-loader' }],
12+
},
13+
devServer: {
14+
port: 3000,
15+
},
16+
};

0 commit comments

Comments
 (0)