Skip to content

Commit e0ab3e9

Browse files
committed
'gulp libs' command to build all libs
1 parent 6949c9e commit e0ab3e9

13 files changed

+139
-19
lines changed

gulpfile.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ gulp.task('webpack', function() {
1010
var gulpWebpack = require('gulp-webpack');
1111
var dir = Path.join('static', 'build');
1212

13-
return gulp
14-
.src(dir)
15-
.pipe(clean())
16-
.pipe(gulpWebpack(webpackConfig))
17-
.pipe(dir);
13+
return gulp.src(dir)
14+
.pipe(clean())
15+
.pipe(gulpWebpack(webpackConfig))
16+
.pipe(gulp.dest(dir));
1817
});
1918
/**************************
2019
* webpack-dev-server *
@@ -43,16 +42,20 @@ gulp.task('webpack-dev-server', function() {
4342
/**************************
4443
* webpack build libs *
4544
**************************/
46-
gulp.task('webpack-build-libs', function() {
47-
var webpackConfig = require('./webpack.libs');
45+
gulp.task('clean-libs', function() {
46+
var dir = Path.join('static', 'libs', '*.min.*');
47+
return gulp.src(dir)
48+
.pipe(clean());
49+
});
50+
gulp.task('webpack-build-libs', ['clean-libs'], function() {
51+
var webpackConfig = require('./webpack.libs.js');
4852
var gulpWebpack = require('gulp-webpack');
49-
var dir = Path.join(__dirname, 'static', 'libs');
53+
var dir = Path.join('static', 'libs');
5054

5155
return gulp
5256
.src(dir)
53-
.pipe(clean())
5457
.pipe(gulpWebpack(webpackConfig))
55-
.pipe(dir);
58+
.pipe(gulp.dest(dir));
5659
});
5760
/**************************
5861
* copy profiles *

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"author": "",
1717
"license": "MIT",
1818
"dependencies": {
19+
"antd": "^1.6.4",
1920
"body-parser": "^1.13.3",
2021
"codemirror": "^5.16.0",
2122
"cookie-parser": "^1.3.5",
@@ -25,8 +26,9 @@
2526
"json-loader": "^0.5.4",
2627
"mysql": "^2.10.2",
2728
"promise": "^7.1.1",
28-
"react": "0.14.6",
29-
"react-dom": "0.14.6",
29+
"react": "^15.2.1",
30+
"react-dom": "^15.2.1",
31+
"react-router": "^2.5.2",
3032
"serve-favicon": "^2.3.0",
3133
"url-loader": "^0.5.7"
3234
},
@@ -39,7 +41,6 @@
3941
"extract-text-webpack-plugin": "^1.0.1",
4042
"postcss-loader": "^0.9.1",
4143
"react-hot-loader": "^1.3.0",
42-
"react-router": "^2.0.0",
4344
"sass-loader": "^3.2.0",
4445
"node-sass": "^3.8.0",
4546
"css-loader": "^0.23.1",

static/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>webpack + react + sass + express</title>
6-
<link rel="stylesheet" href="http://127.0.0.1:3000/build/index.css">
6+
<link rel="stylesheet" href="/static/build/index.css">
77
</head>
88
<body>
99
<div class="main"></div>
10-
<script src="http://127.0.0.1:3000/build/index.js"></script>
10+
<script src="/static/build/index.js"></script>
1111
</body>
1212
</html>

static/libs/antd.min.js

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/antd.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/react-dom.min.js

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/react-dom.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/react-router.min.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/react-router.min.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/libs/react.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)