mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 17:16:57 +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"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^1.2.6",
|
||||
"lodash": "^3.10.1",
|
||||
"normalize.css": "^3.0.3",
|
||||
"react": "^0.14.0",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*eslint no-console:0 */
|
||||
require('core-js/fn/object/assign');
|
||||
var webpack = require('webpack');
|
||||
var WebpackDevServer = require('webpack-dev-server');
|
||||
var config = require('./webpack.config');
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'core-js/fn/object/assign';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
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';
|
||||
|
||||
const config = {
|
||||
import baseConfig from './base';
|
||||
|
||||
|
||||
let config = {
|
||||
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';
|
||||
|
||||
const config = {
|
||||
import baseConfig from './base';
|
||||
|
||||
|
||||
let config = {
|
||||
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';
|
||||
|
||||
const config = {
|
||||
import baseConfig from './base';
|
||||
|
||||
|
||||
let config = {
|
||||
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';
|
||||
|
||||
require('core-js/fn/object/assign');
|
||||
|
||||
// Add support for all files in the test directory
|
||||
const testsContext = require.context('.', true, /(Test\.js$)|(Helper\.js$)/);
|
||||
testsContext.keys().forEach(testsContext);
|
||||
|
||||
Reference in New Issue
Block a user