Skip to content

Commit 3f6cf6a

Browse files
committed
Merge branch 'release/0.0.1'
2 parents 34b9e44 + 1f322f0 commit 3f6cf6a

File tree

6 files changed

+51
-16
lines changed

6 files changed

+51
-16
lines changed

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"name": "Launch with sourcemaps",
6+
"type": "chrome",
7+
"request": "launch",
8+
"url": "http://localhost/mypage.html",
9+
"webRoot": "${workspaceRoot}/dist",
10+
"sourceMaps": true
11+
},
412
{
513
"name": "Attach with sourcemaps",
614
"type": "chrome",

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Typescript Webpack Starter
2+
>A damn simple ES6 and Typescript Starter kit using webpack for packaging. Perfect for bootstraping your javascript project regardless any framework.
3+
4+
# Getting started
5+
6+
## Clone Typescript Webpack Starter
7+
```bash
8+
git clone https://github.com/emyann/typescript-webpack-starter.git
9+
cd typescript-webpack-starter
10+
```
211

3-
A damn simple starter kit to bootstrap a Typescript/ES6
412
## Build
513
Build a development release
614
```bash
@@ -13,19 +21,10 @@ Build a production release
1321
npm install
1422
npm run build:prod
1523
```
16-
Bundled files are outputed to `dist` folder
17-
18-
## Debug
19-
20-
### Issues whith Chrome Debugger
21-
Sometimes Chrome debugger is not correctly initialized, as a consequence for VSCode to receive an access denied from Chrome on port 9222.
22-
23-
The workaround is to close all Chrome instances and run it manually enabling debugging port
24-
```bat
25-
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
26-
```
24+
Bundled files are releases into `dist` folder
2725

2826
## TODO
2927

30-
- [-] Add samples (Jquery integration)
31-
- [-] Add Webpack HTML Plugin to generate an index.html
28+
- [-] Add samples (Jquery integration for example..)
29+
- [-] Setup a webpack-dev-server
30+
- [-] Setup VSCode debuug to match webpack-dev-server

config/webpack/webpack.dev.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var path = require("path");
22
var webpack = require("webpack");
3+
var HtmlWebpackPlugin = require('html-webpack-plugin');
34

45
var config = {
56

@@ -34,7 +35,13 @@ var config = {
3435
{ test: /\.html$/, loader: "html" },
3536
{ test: /\.css$/, loader: "style-loader!css-loader" }
3637
]
37-
}
38+
},
39+
plugins: [
40+
new HtmlWebpackPlugin({
41+
title: 'Typescript Webpack Starter',
42+
template: '!!ejs-loader!src/index.html'
43+
})
44+
]
3845
};
3946

4047
module.exports = config;

config/webpack/webpack.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var path = require("path");
22
var webpack = require("webpack");
3+
var HtmlWebpackPlugin = require('html-webpack-plugin');
34

45
var config = {
56

@@ -37,6 +38,7 @@ var config = {
3738
},
3839
plugins: [
3940
new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }),
41+
new HtmlWebpackPlugin({title: 'Typescript Webpack Starter'})
4042
]
4143
};
4244

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
"license": "ISC",
2323
"devDependencies": {
2424
"css-loader": "^0.23.1",
25+
"ejs-loader": "^0.3.0",
2526
"expose-loader": "^0.7.1",
2627
"html-loader": "^0.4.3",
28+
"html-webpack-plugin": "^2.22.0",
2729
"rimraf": "^2.5.4",
2830
"style-loader": "^0.13.1",
2931
"ts-loader": "^0.8.2",
@@ -34,6 +36,6 @@
3436
"webpack": "^1.13.1"
3537
},
3638
"dependencies": {
37-
"lodash":"^4.14.1"
39+
"lodash": "^4.14.1"
3840
}
3941
}

src/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="x-ua-compatible" content="ie=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
10+
<meta name="description" content="<%= htmlWebpackPlugin.options.title %>">
11+
12+
</head>
13+
14+
<body>
15+
<div> You have successfully started your Typescript application using Webpack</div>
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)