From 676ef90856127c0bce057e14c1f0fd7dfd7fbffa Mon Sep 17 00:00:00 2001 From: Zalmoxisus Date: Tue, 19 Jul 2016 14:58:28 +0300 Subject: [PATCH] Strip the code from production bundle by default --- examples/counter/stores/appState.js | 2 +- examples/todomvc/src/stores/TodoStore.js | 2 +- examples/todomvc/src/stores/ViewStore.js | 2 +- src/index.js | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/counter/stores/appState.js b/examples/counter/stores/appState.js index 4c1cd03..f31698d 100644 --- a/examples/counter/stores/appState.js +++ b/examples/counter/stores/appState.js @@ -1,5 +1,5 @@ import { observable, action, extras } from 'mobx'; -import remotedev from '../../../src'; // import remotedev from 'mobx-remotedev'; +import remotedev from '../../../src/dev'; // import remotedev from 'mobx-remotedev/lib/dev'; const appState = observable({ count: 0 diff --git a/examples/todomvc/src/stores/TodoStore.js b/examples/todomvc/src/stores/TodoStore.js index 2fab7c5..705f216 100755 --- a/examples/todomvc/src/stores/TodoStore.js +++ b/examples/todomvc/src/stores/TodoStore.js @@ -1,5 +1,5 @@ import {observable, computed, action, autorun} from 'mobx'; -import remotedev from '../../../../src'; // import remotedev from 'mobx-remotedev'; +import remotedev from '../../../../src/dev'; // import remotedev from 'mobx-remotedev/lib/dev'; import TodoModel from '../models/TodoModel' import * as Utils from '../utils'; diff --git a/examples/todomvc/src/stores/ViewStore.js b/examples/todomvc/src/stores/ViewStore.js index a768236..a8cd8b8 100755 --- a/examples/todomvc/src/stores/ViewStore.js +++ b/examples/todomvc/src/stores/ViewStore.js @@ -1,6 +1,6 @@ import {observable} from 'mobx'; import { ALL_TODOS } from '../constants'; -import remotedev from '../../../../src'; // import remotedev from 'mobx-remotedev'; +import remotedev from '../../../../src/dev'; // import remotedev from 'mobx-remotedev/lib/dev'; class ViewStore { @observable todoBeingEdited = null; diff --git a/src/index.js b/src/index.js index fd978de..92faff1 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1,5 @@ -module.exports = require('./dev').default; +if (process.env.NODE_ENV === 'development') { + module.exports = require('./dev').default; // eslint-disable-line global-require +} else { + module.exports = store => store; +}