Skip to content

Move configs to a separate folder #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions webpack.config.dev.js → config/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var isInNodeModules = 'node_modules' ===
path.basename(path.resolve(path.join(__dirname, '..')));
var relative = isInNodeModules ? '../..' : '.';
path.basename(path.resolve(path.join(__dirname, '..', '..')));
var relative = isInNodeModules ? '../../..' : '..';

module.exports = {
devtool: 'eval',
4 changes: 2 additions & 2 deletions webpack.config.prod.js → config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');

var isInNodeModules = 'node_modules' ===
path.basename(path.resolve(path.join(__dirname, '..')));
var relative = isInNodeModules ? '../..' : '.';
path.basename(path.resolve(path.join(__dirname, '..', '..')));
var relative = isInNodeModules ? '../../..' : '..';

module.exports = {
devtool: 'source-map',
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -9,13 +9,11 @@
"files": [
"LICENSE",
"PATENTS",
".eslintrc",
"bin",
"config",
"scripts",
"src",
"index.html",
"webpack.config.dev.js",
"webpack.config.prod.js"
"index.html"
],
"bin": {
"start-react-app": "./bin/start-react-app.js",
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ process.env.NODE_ENV = 'production';
var path = require('path');
var rimrafSync = require('rimraf').sync;
var webpack = require('webpack');
var config = require('../webpack.config.prod');
var config = require('../config/webpack.config.prod');

var isInNodeModules = 'node_modules' ===
path.basename(path.resolve(path.join(__dirname, '..', '..')));
12 changes: 7 additions & 5 deletions scripts/eject.js
Original file line number Diff line number Diff line change
@@ -40,11 +40,11 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
var hostPath = path.join(selfPath, '..', '..');

var files = [
path.join('scripts', 'build.js'),
path.join('scripts', 'start.js'),
'webpack.config.dev.js',
'webpack.config.prod.js',
'.eslintrc'
path.join('config', '.eslintrc'),
path.join('config', 'webpack.config.dev.js'),
path.join('config', 'webpack.config.prod.js'),
path.join('scripts', 'build.js'),
path.join('scripts', 'start.js')
];

// Ensure that the host folder is clean and we won't override any files
@@ -61,7 +61,9 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
});

// Copy the files over
fs.mkdirSync(path.join(hostPath, 'config'));
fs.mkdirSync(path.join(hostPath, 'scripts'));

files.forEach(function(file) {
console.log('Copying ' + file + ' to ' + hostPath);
var content = fs.readFileSync(path.join(selfPath, file), 'utf8');
2 changes: 1 addition & 1 deletion scripts/start.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ process.env.NODE_ENV = 'development';

var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('../webpack.config.dev');
var config = require('../config/webpack.config.dev');
var execSync = require('child_process').execSync;
var opn = require('opn');