Skip to content

Commit bba305f

Browse files
author
Andrey Morozov
committed
add command for development (close #1)
1 parent 2eae0a3 commit bba305f

File tree

5 files changed

+51
-17
lines changed

5 files changed

+51
-17
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,33 @@ src/js Javascript files
3636
src/styles CSS or Stylus files
3737
```
3838

39-
## How to develop?
40-
### Build project
39+
## Commands
40+
41+
### For build project
4142
```
4243
npm run build
4344
```
4445

45-
### Static code analyser and codestyle checking
46+
Builded version located in `./build` directory.
47+
48+
### For development
49+
```
50+
npm run dev
51+
```
52+
53+
After that open [http://localhost:8080/webpack-dev-server/](http://localhost:8080/webpack-dev-server/) with your favorite browser.
54+
55+
### For static code analyse and codestyle checking
4656
```
4757
npm run lint
4858
```
4959

50-
### Run tests
60+
### For run tests
5161
Run tests:
5262
```
5363
npm run test
5464
```
5565

66+
5667
## Contribution
5768
* [Codestyle](https://github.com/yandex/codestyle/blob/master/javascript.md)

README.ru.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,28 @@ src/js Javascript файлы
3434
src/styles CSS или Stylus файлы
3535
```
3636

37-
## Как разрабатывать?
38-
### Собрать проект
37+
## Команды
38+
39+
### Для собрки проект
3940
```
4041
npm run build
4142
```
4243

43-
### Статический анализ кода и проверка стиля
44+
Собранная версия проекта находится в `./build` директории.
45+
46+
### Для разработки
47+
```
48+
npm run dev
49+
```
50+
51+
После этого откройте [http://localhost:8080/webpack-dev-server/](http://localhost:8080/webpack-dev-server/) в своем любимом браузере.
52+
53+
### Для статического анализа кода и проверки стиля
4454
```
4555
npm run lint
4656
```
4757

48-
### Запуск тестов
58+
### Для запуска тестов
4959
Run tests:
5060
```
5161
npm run test

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
{
22
"name": "iseed",
33
"description": "Start a frontend project in under 5 minutes, with full test and build infrastructure.",
4-
"version": "1.0.1",
4+
"version": "1.1.0",
55
"author": "Andrey Morozov <[email protected]>",
6-
"contributors": [{
7-
"name": "Alexander Tarmolov",
8-
"email": "[email protected]"
9-
}],
6+
"contributors": [
7+
{
8+
"name": "Alexander Tarmolov",
9+
"email": "[email protected]"
10+
}
11+
],
1012
"keywords": [
1113
"frontend",
1214
"project",
@@ -32,8 +34,9 @@
3234
"css-loader": "0.9.0",
3335
"eslint": "1.3.1",
3436
"git-hooks": "1.0.0",
37+
"html-webpack-plugin": "1.6.1",
3538
"jscs": "2.1.1",
36-
"karma": "^0.13.9",
39+
"karma": "0.13.9",
3740
"karma-cli": "0.1.0",
3841
"karma-mocha": "0.2.0",
3942
"karma-phantomjs-launcher": "0.2.1",
@@ -49,7 +52,8 @@
4952
"webpack-dev-server": "1.10.1"
5053
},
5154
"scripts": {
52-
"build": "cp -r src/assets build && webpack -p",
55+
"dev": "webpack-dev-server",
56+
"build": "webpack -p",
5357
"validate": "npm run lint && npm run test",
5458
"lint": "jscs . && eslint .",
5559
"test": "karma start karma.conf.js"

src/assets/index.html renamed to src/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88

99
<body>
1010
<h1>Hello, world!</h1>
11-
<script src="build.js"></script>
1211
</body>
1312
</html>

webpack.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var webpack = require('webpack');
2+
var HtmlWebpackPlugin = require('html-webpack-plugin');
23
var environment = process.env.NODE_ENV || 'development';
34

45
module.exports = {
@@ -29,12 +30,21 @@ module.exports = {
2930
},
3031

3132
plugins: [
33+
new HtmlWebpackPlugin({
34+
inject: 'body',
35+
filename: 'index.html',
36+
template: __dirname + '/src/index.html'
37+
}),
3238
new webpack.DefinePlugin({'process.env.NODE_ENV': '"' + environment + '"'}),
3339
new webpack.optimize.DedupePlugin(),
3440
new webpack.optimize.UglifyJsPlugin({
3541
compress: {
3642
warnings: false
3743
}
3844
})
39-
]
45+
],
46+
47+
devServer: {
48+
contentBase: './build'
49+
}
4050
};

0 commit comments

Comments
 (0)