Skip to content

Commit a73ebe8

Browse files
authored
Move configs to a separate folder (#23)
1 parent 7a15b7e commit a73ebe8

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed
File renamed without changes.

webpack.config.dev.js renamed to config/webpack.config.dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ var webpack = require('webpack');
1313
var HtmlWebpackPlugin = require('html-webpack-plugin');
1414

1515
var isInNodeModules = 'node_modules' ===
16-
path.basename(path.resolve(path.join(__dirname, '..')));
17-
var relative = isInNodeModules ? '../..' : '.';
16+
path.basename(path.resolve(path.join(__dirname, '..', '..')));
17+
var relative = isInNodeModules ? '../../..' : '..';
1818

1919
module.exports = {
2020
devtool: 'eval',

webpack.config.prod.js renamed to config/webpack.config.prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ var webpack = require('webpack');
1313
var HtmlWebpackPlugin = require('html-webpack-plugin');
1414

1515
var isInNodeModules = 'node_modules' ===
16-
path.basename(path.resolve(path.join(__dirname, '..')));
17-
var relative = isInNodeModules ? '../..' : '.';
16+
path.basename(path.resolve(path.join(__dirname, '..', '..')));
17+
var relative = isInNodeModules ? '../../..' : '..';
1818

1919
module.exports = {
2020
devtool: 'source-map',

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
"files": [
1010
"LICENSE",
1111
"PATENTS",
12-
".eslintrc",
1312
"bin",
13+
"config",
1414
"scripts",
1515
"src",
16-
"index.html",
17-
"webpack.config.dev.js",
18-
"webpack.config.prod.js"
16+
"index.html"
1917
],
2018
"bin": {
2119
"start-react-app": "./bin/start-react-app.js",

scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ process.env.NODE_ENV = 'production';
1212
var path = require('path');
1313
var rimrafSync = require('rimraf').sync;
1414
var webpack = require('webpack');
15-
var config = require('../webpack.config.prod');
15+
var config = require('../config/webpack.config.prod');
1616

1717
var isInNodeModules = 'node_modules' ===
1818
path.basename(path.resolve(path.join(__dirname, '..', '..')));

scripts/eject.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
4040
var hostPath = path.join(selfPath, '..', '..');
4141

4242
var files = [
43-
path.join('scripts', 'build.js'),
44-
path.join('scripts', 'start.js'),
45-
'webpack.config.dev.js',
46-
'webpack.config.prod.js',
47-
'.eslintrc'
43+
path.join('config', '.eslintrc'),
44+
path.join('config', 'webpack.config.dev.js'),
45+
path.join('config', 'webpack.config.prod.js'),
46+
path.join('scripts', 'build.js'),
47+
path.join('scripts', 'start.js')
4848
];
4949

5050
// 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
6161
});
6262

6363
// Copy the files over
64+
fs.mkdirSync(path.join(hostPath, 'config'));
6465
fs.mkdirSync(path.join(hostPath, 'scripts'));
66+
6567
files.forEach(function(file) {
6668
console.log('Copying ' + file + ' to ' + hostPath);
6769
var content = fs.readFileSync(path.join(selfPath, file), 'utf8');

scripts/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ process.env.NODE_ENV = 'development';
1111

1212
var webpack = require('webpack');
1313
var WebpackDevServer = require('webpack-dev-server');
14-
var config = require('../webpack.config.dev');
14+
var config = require('../config/webpack.config.dev');
1515
var execSync = require('child_process').execSync;
1616
var opn = require('opn');
1717

0 commit comments

Comments
 (0)