Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 22, 2016
1 parent c7bc89c commit 024b4d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

function isInDebugMode() {
return process.argv.some(function (item) { return item.indexOf('--debug-template') > -1 });
}

// TODO: hide this behind a flag and eliminate dead code on eject.
// This shouldn't be exposed to the user.
var isInNodeModules = 'node_modules' ===
path.basename(path.resolve(path.join(__dirname, '..', '..')));
var relativePath = isInNodeModules ? '../../..' : '..';
if (isInDebugMode()) {
var isInDebugMode = process.argv.some(arg =>
arg.indexOf('--debug-template') > -1
);
if (isInDebugMode) {
relativePath = '../template';
}
var srcPath = path.resolve(__dirname, relativePath, 'src');
Expand Down
9 changes: 4 additions & 5 deletions scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ var config = require('../config/webpack.config.dev');
var execSync = require('child_process').execSync;
var opn = require('opn');

function isSmokeTest() {
return process.argv.some(function (item) { return item.indexOf('--smoke-test') > -1 });
}

// TODO: hide this behind a flag and eliminate dead code on eject.
// This shouldn't be exposed to the user.
var handleCompile;
if (isSmokeTest()) {
var isSmokeTest = process.argv.some(arg =>
arg.indexOf('--smoke-test') > -1
);
if (isSmokeTest) {
handleCompile = function (err, stats) {
if (err || stats.hasErrors() || stats.hasWarnings()) {
process.exit(1);
Expand Down

0 comments on commit 024b4d4

Please sign in to comment.