Skip to content

Commit 66d5754

Browse files
committed
change webpack global var
1 parent d1bfeb5 commit 66d5754

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

.eslintrc.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ const eslintrc = {
1111
}
1212
},
1313
"globals": {
14-
"__DEV__": false,
15-
"__TEST__": false,
16-
"__PROD__": false,
17-
"__COVERAGE__": false,
14+
"isDev": false,
15+
"isTest": false,
16+
"isProd": false,
1817
"window": false
1918
},
2019
"parser": "babel-eslint",

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ lib-cov
1010
pids
1111
logs
1212
results
13+
dist
1314

1415
npm-debug.log
1516
node_modules

bin/compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const startCompile = () => {
1010
return Promise.resolve()
1111
.then(() => compiler(webpackConfig))
1212
.then((stats) => {
13-
if (stats.hasWarnings() && env.__PROD__) { // eslint-disable-line
13+
if (stats.hasWarnings() && env.isProd) { // eslint-disable-line
1414
throw new Error('Production not allow warnig, exit .');
1515
}
1616
debug('Copying static assets to dist folder.');

build/webpack-config/alias.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = paths => ({
22
UTILS: paths.src('utils'),
33
COMPONENTS: paths.src('components'),
44
CONTAINERS: paths.src('containers'),
5-
STYLES: paths.src('static/styles'),
5+
STYLES: paths.src('styles'),
66
REDUCERS: paths.src('reducers'),
77
LAYOUTS: paths.src('layouts')
88
});

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let render = () => {
1616
MOUNT_NODE
1717
);
1818
};
19-
if (__DEV__ && module.hot) {
19+
if (isDev && module.hot) {
2020
const renderApp = render;
2121
const renderError = (error) => {
2222
const RedBox = require('redbox-react').default; // eslint-disable-line

src/store/createStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default (initialState = {}) => {
1010
const enhancers = [];
1111
const globalReducerMaps = [];
1212

13-
if (__DEV__) {
13+
if (isDev) {
1414
const devToolsExtension = window.devToolsExtension;
1515
if (typeof devToolsExtension === 'function') {
1616
enhancers.push(devToolsExtension());
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)