Skip to content

Commit 8f0410e

Browse files
authored
Merge pull request #53 from iroy2000/make-webpack-config-more-easy-to-reason
Make webpack config more easy to reason
2 parents fd7e8e6 + 3e9d243 commit 8f0410e

13 files changed

+56
-84
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"react/prop-types": 0,
3232
"react/jsx-filename-extension": 0,
3333
"comma-dangle": [2, "always-multiline"],
34+
"arrow-parens": ["warn", "always"],
3435
"jsx-a11y/anchor-is-valid": [ "error", {
3536
"components": [ "Link" ],
3637
"specialLink": [ "to", "hrefLeft", "hrefRight" ],

bin/commands.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ const colors = require('colors');
55
const host = config.get('host') || 'localhost';
66
const port = config.get('port') || '8080';
77

8-
console.log('using settings:');
9-
console.log('\thost:', host);
10-
console.log('\tport:', port);
11-
128
const option = process.argv[2];
139

1410
switch (option) {
1511
case 'lint':
1612
shell.exec('cross-env eslint src/js/** server/** --format node_modules/eslint-friendly-formatter . --ext .js --ext .jsx --cache; exit 0');
1713
break;
1814
case 'dev':
19-
shell.exec(`cross-env HOST=${host} PORT=${port} webpack-dev-server --hot --progress --no-info --inline --colors --content-base ./docroot`);
15+
shell.exec(`cross-env HOST=${host} PORT=${port} webpack-dev-server --config webpack.config.dev-server.babel.js --hot --progress --no-info --inline --colors --content-base ./docroot`);
2016
break;
2117
case 'build':
22-
shell.exec(`cross-env rimraf docroot && webpack --progress --display-error-details`);
18+
shell.exec(`cross-env rimraf docroot && webpack --config webpack.config.build.babel.js --progress --display-error-details`);
2319
break;
2420
default:
2521
// If the app type is invalid, stop execution of the file.

bin/shouldBuild.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

bin/start.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

config/default.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"env": "default",
33
"host": "localhost",
44
"port": "8080",
5+
"publicPath": "/",
6+
"assetPath": "assets",
57
"jsSourcePath": "src/js",
68
"s3": {
79
"s3Deploy": false,

config/development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"env": "development",
33
"app": {
44
"description": "you can overwrite the default config",
5-
"hello": "Config is configurable"
5+
"hello": "You are in local development mode"
66
}
77
}

config/production.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"env": "production",
3-
"publicPath": "./"
3+
"publicPath": "/"
44
}
File renamed without changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"dev": "cross-env NODE_ENV=development DASHBOARD_PORT=9901 webpack-dashboard -p 9901 -c red -t dashboard -- node bin/commands.js dev",
77
"build": "cross-env NODE_ENV=production node bin/commands.js build",
8-
"build:release": "cross-env NODE_ENV=release node bin/commands.js build",
8+
"build:stage": "cross-env NODE_ENV=stage node bin/commands.js build",
99
"clean": "rimraf docroot",
1010
"test": "jest --no-cache",
1111
"lint": "node bin/commands.js lint"

webpack.config.babel.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)