Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 024b4d4

Browse files
committed
Minor tweaks
1 parent c7bc89c commit 024b4d4

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

config/webpack.config.dev.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ var autoprefixer = require('autoprefixer');
1212
var webpack = require('webpack');
1313
var HtmlWebpackPlugin = require('html-webpack-plugin');
1414

15-
function isInDebugMode() {
16-
return process.argv.some(function (item) { return item.indexOf('--debug-template') > -1 });
17-
}
18-
1915
// TODO: hide this behind a flag and eliminate dead code on eject.
2016
// This shouldn't be exposed to the user.
2117
var isInNodeModules = 'node_modules' ===
2218
path.basename(path.resolve(path.join(__dirname, '..', '..')));
2319
var relativePath = isInNodeModules ? '../../..' : '..';
24-
if (isInDebugMode()) {
20+
var isInDebugMode = process.argv.some(arg =>
21+
arg.indexOf('--debug-template') > -1
22+
);
23+
if (isInDebugMode) {
2524
relativePath = '../template';
2625
}
2726
var srcPath = path.resolve(__dirname, relativePath, 'src');

scripts/start.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ var config = require('../config/webpack.config.dev');
1717
var execSync = require('child_process').execSync;
1818
var opn = require('opn');
1919

20-
function isSmokeTest() {
21-
return process.argv.some(function (item) { return item.indexOf('--smoke-test') > -1 });
22-
}
23-
2420
// TODO: hide this behind a flag and eliminate dead code on eject.
2521
// This shouldn't be exposed to the user.
2622
var handleCompile;
27-
if (isSmokeTest()) {
23+
var isSmokeTest = process.argv.some(arg =>
24+
arg.indexOf('--smoke-test') > -1
25+
);
26+
if (isSmokeTest) {
2827
handleCompile = function (err, stats) {
2928
if (err || stats.hasErrors() || stats.hasWarnings()) {
3029
process.exit(1);

0 commit comments

Comments
 (0)