File tree Expand file tree Collapse file tree 6 files changed +51
-16
lines changed Expand file tree Collapse file tree 6 files changed +51
-16
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"version" : " 0.2.0" ,
3
3
"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
+ },
4
12
{
5
13
"name" : " Attach with sourcemaps" ,
6
14
"type" : " chrome" ,
Original file line number Diff line number Diff line change 1
1
# 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
+ ```
2
11
3
- A damn simple starter kit to bootstrap a Typescript/ES6
4
12
## Build
5
13
Build a development release
6
14
``` bash
@@ -13,19 +21,10 @@ Build a production release
13
21
npm install
14
22
npm run build:prod
15
23
```
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
27
25
28
26
## TODO
29
27
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
Original file line number Diff line number Diff line change 1
1
var path = require ( "path" ) ;
2
2
var webpack = require ( "webpack" ) ;
3
+ var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
3
4
4
5
var config = {
5
6
@@ -34,7 +35,13 @@ var config = {
34
35
{ test : / \. h t m l $ / , loader : "html" } ,
35
36
{ test : / \. c s s $ / , loader : "style-loader!css-loader" }
36
37
]
37
- }
38
+ } ,
39
+ plugins : [
40
+ new HtmlWebpackPlugin ( {
41
+ title : 'Typescript Webpack Starter' ,
42
+ template : '!!ejs-loader!src/index.html'
43
+ } )
44
+ ]
38
45
} ;
39
46
40
47
module . exports = config ;
Original file line number Diff line number Diff line change 1
1
var path = require ( "path" ) ;
2
2
var webpack = require ( "webpack" ) ;
3
+ var HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
3
4
4
5
var config = {
5
6
@@ -37,6 +38,7 @@ var config = {
37
38
} ,
38
39
plugins : [
39
40
new webpack . optimize . UglifyJsPlugin ( { compress : { warnings : false } } ) ,
41
+ new HtmlWebpackPlugin ( { title : 'Typescript Webpack Starter' } )
40
42
]
41
43
} ;
42
44
Original file line number Diff line number Diff line change 22
22
"license" : " ISC" ,
23
23
"devDependencies" : {
24
24
"css-loader" : " ^0.23.1" ,
25
+ "ejs-loader" : " ^0.3.0" ,
25
26
"expose-loader" : " ^0.7.1" ,
26
27
"html-loader" : " ^0.4.3" ,
28
+ "html-webpack-plugin" : " ^2.22.0" ,
27
29
"rimraf" : " ^2.5.4" ,
28
30
"style-loader" : " ^0.13.1" ,
29
31
"ts-loader" : " ^0.8.2" ,
34
36
"webpack" : " ^1.13.1"
35
37
},
36
38
"dependencies" : {
37
- "lodash" :" ^4.14.1"
39
+ "lodash" : " ^4.14.1"
38
40
}
39
41
}
Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments