style(gulpfile): Remove object assign
This commit is contained in:
15
gulpfile.js
15
gulpfile.js
@ -1,5 +1,4 @@
|
|||||||
// enable debug for gulp
|
// enable debug for gulp
|
||||||
/* eslint-disable prefer-object-spread/prefer-object-spread */
|
|
||||||
process.env.DEBUG = process.env.DEBUG || 'fcc:*';
|
process.env.DEBUG = process.env.DEBUG || 'fcc:*';
|
||||||
require('dotenv').load();
|
require('dotenv').load();
|
||||||
|
|
||||||
@ -291,11 +290,10 @@ gulp.task('pack-client', function() {
|
|||||||
|
|
||||||
return gulp.src(webpackConfig.entry.bundle)
|
return gulp.src(webpackConfig.entry.bundle)
|
||||||
.pipe(plumber({ errorHandler }))
|
.pipe(plumber({ errorHandler }))
|
||||||
.pipe(webpackStream(Object.assign(
|
.pipe(webpackStream({
|
||||||
{},
|
...webpackConfig,
|
||||||
webpackConfig,
|
...webpackOptions
|
||||||
webpackOptions
|
}))
|
||||||
)))
|
|
||||||
.pipe(gulpif(condition, gutil.noop(), uglify()))
|
.pipe(gulpif(condition, gutil.noop(), uglify()))
|
||||||
.pipe(gulp.dest(dest));
|
.pipe(gulp.dest(dest));
|
||||||
});
|
});
|
||||||
@ -412,9 +410,8 @@ gulp.task('js', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function collector(file, memo) {
|
const collector = (file, memo) =>
|
||||||
return Object.assign({}, JSON.parse(file.contents), memo);
|
Object.assign(memo, JSON.parse(file.contents));
|
||||||
}
|
|
||||||
|
|
||||||
function done(manifest) {
|
function done(manifest) {
|
||||||
return sortKeys(manifest);
|
return sortKeys(manifest);
|
||||||
|
58
webpack.frame-runner.js
Normal file
58
webpack.frame-runner.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
const webpack = require('webpack');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const __DEV__ = process.env.NODE_ENV !== 'production';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: {
|
||||||
|
'frame-runner': './client/frame-runner.js'
|
||||||
|
},
|
||||||
|
devtool: __DEV__ ? 'inline-source-map' : null,
|
||||||
|
node: {
|
||||||
|
// Mock Node.js modules that Babel require()s but that we don't
|
||||||
|
// particularly care about.
|
||||||
|
fs: 'empty',
|
||||||
|
module: 'empty',
|
||||||
|
net: 'empty'
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: '[name].js',
|
||||||
|
chunkFilename: '[name]-[name].js',
|
||||||
|
path: path.join(__dirname, '/public/js'),
|
||||||
|
publicPath: '/js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.jsx?$/,
|
||||||
|
include: [ path.join(__dirname, 'client/') ],
|
||||||
|
loaders: [ 'babel' ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
rx: 'Rx'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
NODE_ENV: JSON.stringify(__DEV__ ? 'development' : 'production')
|
||||||
|
},
|
||||||
|
__DEVTOOLS__: !__DEV__
|
||||||
|
}),
|
||||||
|
// Use browser version of visionmedia-debug
|
||||||
|
new webpack.NormalModuleReplacementPlugin(
|
||||||
|
/debug\/node/,
|
||||||
|
'debug/src/browser'
|
||||||
|
),
|
||||||
|
new webpack.optimize.DedupePlugin(),
|
||||||
|
new webpack.optimize.OccurenceOrderPlugin(true)
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
if (__DEV__) {
|
||||||
|
module.exports.plugins.push(
|
||||||
|
// prevents build on error
|
||||||
|
new webpack.NoErrorsPlugin()
|
||||||
|
);
|
||||||
|
}
|
Reference in New Issue
Block a user