add react build script
parent
38cb4b2873
commit
4bacd87943
16
gulpfile.js
16
gulpfile.js
|
@ -62,6 +62,10 @@ var paths = {
|
|||
]
|
||||
};
|
||||
|
||||
var webpackOptions = {
|
||||
devtool: 'inline-source-map'
|
||||
};
|
||||
|
||||
function errorHandler() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
|
||||
|
@ -87,14 +91,22 @@ gulp.task('inject', function() {
|
|||
gulp.task('pack-client', function() {
|
||||
return gulp.src(webpackConfig.entry)
|
||||
.pipe(plumber({ errorHandler }))
|
||||
.pipe(webpack(webpackConfig))
|
||||
.pipe(webpack(Object.assign(
|
||||
{},
|
||||
webpackConfig,
|
||||
webpackOptions
|
||||
)))
|
||||
.pipe(gulp.dest(webpackConfig.output.path));
|
||||
});
|
||||
|
||||
gulp.task('pack-watch', function() {
|
||||
return gulp.src(webpackConfig.entry)
|
||||
.pipe(plumber({ errorHandler }))
|
||||
.pipe(webpack(Object.assign(webpackConfig, { watch: true })))
|
||||
.pipe(webpack(Object.assign(
|
||||
{},
|
||||
webpackConfig,
|
||||
{ watch: true }
|
||||
)))
|
||||
.pipe(gulp.dest(webpackConfig.output.path));
|
||||
});
|
||||
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
"url": "https://github.com/freecodecamp/freecodecamp.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build-production": "webpack",
|
||||
"start": "babel-node server/server.js",
|
||||
"prestart-production": "bower cache clean && bower install && gulp build",
|
||||
"prestart-production": "bower cache clean && bower install && gulp build && npm run build-production",
|
||||
"start-production": "node pm2Start",
|
||||
"lint": "eslint --ext=.js,.jsx .",
|
||||
"test": "mocha"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
var path = require('path');
|
||||
|
||||
module.exports = {
|
||||
devtool: 'inline-source-map',
|
||||
entry: './client',
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
|
|
Loading…
Reference in New Issue