mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 18:25:20 +08:00
Merge pull request #13 from sthzg/feat_update_app_config
Config -- added base config object for env-independent settings (Provided by @sthzg)
This commit is contained in:
@@ -72,6 +72,7 @@
|
|||||||
"webpack-dev-server": "^1.12.0"
|
"webpack-dev-server": "^1.12.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"core-js": "^1.2.6",
|
||||||
"lodash": "^3.10.1",
|
"lodash": "^3.10.1",
|
||||||
"normalize.css": "^3.0.3",
|
"normalize.css": "^3.0.3",
|
||||||
"react": "^0.14.0",
|
"react": "^0.14.0",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*eslint no-console:0 */
|
/*eslint no-console:0 */
|
||||||
|
require('core-js/fn/object/assign');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var WebpackDevServer = require('webpack-dev-server');
|
var WebpackDevServer = require('webpack-dev-server');
|
||||||
var config = require('./webpack.config');
|
var config = require('./webpack.config');
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'core-js/fn/object/assign';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import App from './Main';
|
import App from './Main';
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
// Settings configured here will be merged into the final config object.
|
||||||
|
export default {
|
||||||
|
}
|
||||||
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const config = {
|
import baseConfig from './base';
|
||||||
|
|
||||||
|
|
||||||
|
let config = {
|
||||||
appEnv: 'dev' // feel free to remove the appEnv property here
|
appEnv: 'dev' // feel free to remove the appEnv property here
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default Object.freeze(Object.assign({}, baseConfig, config));
|
||||||
|
|||||||
+6
-2
@@ -1,7 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const config = {
|
import baseConfig from './base';
|
||||||
|
|
||||||
|
|
||||||
|
let config = {
|
||||||
appEnv: 'dist' // feel free to remove the appEnv property here
|
appEnv: 'dist' // feel free to remove the appEnv property here
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default Object.freeze(Object.assign({}, baseConfig, config));
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -1,7 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const config = {
|
import baseConfig from './base';
|
||||||
|
|
||||||
|
|
||||||
|
let config = {
|
||||||
appEnv: 'test' // don't remove the appEnv property here
|
appEnv: 'test' // don't remove the appEnv property here
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default Object.freeze(Object.assign(baseConfig, config));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
require('core-js/fn/object/assign');
|
||||||
|
|
||||||
// Add support for all files in the test directory
|
// Add support for all files in the test directory
|
||||||
const testsContext = require.context('.', true, /(Test\.js$)|(Helper\.js$)/);
|
const testsContext = require.context('.', true, /(Test\.js$)|(Helper\.js$)/);
|
||||||
testsContext.keys().forEach(testsContext);
|
testsContext.keys().forEach(testsContext);
|
||||||
|
|||||||
Reference in New Issue
Block a user