Skip to content

Commit

Permalink
Exclude dev utils from production build (kriasoft#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzzy authored and koistya committed Apr 29, 2017
1 parent d1c9b23 commit 823b17a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"markdown-it": "^8.3.1",
"mkdirp": "^0.5.1",
"mocha": "^3.3.0",
"null-loader": "^0.1.1",
"pixrem": "^3.0.2",
"pleeease-filters": "^3.0.1",
"postcss": "^5.2.17",
Expand Down
3 changes: 2 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

import React from 'react';
import ReactDOM from 'react-dom';
import ErrorReporter from 'redbox-react';
import deepForceUpdate from 'react-deep-force-update';
import FastClick from 'fastclick';
import queryString from 'query-string';
import { createPath } from 'history/PathUtils';
import App from './components/App';
import createFetch from './createFetch';
import history from './history';
import { updateMeta } from './DOMUtils';
import { ErrorReporter, deepForceUpdate } from './devUtils';

/* eslint-disable global-require */

Expand Down
22 changes: 0 additions & 22 deletions src/devUtils.js

This file was deleted.

12 changes: 12 additions & 0 deletions tools/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ const config = {
limit: 10000,
},
},

// Exclude dev modules from production build
...isDebug ? [] : [
{
test: path.resolve(__dirname, '../node_modules/redbox-react/lib/index.js'),
use: 'null-loader',
},
{
test: path.resolve(__dirname, '../node_modules/react-deep-force-update/lib/index.js'),
use: 'null-loader',
},
],
],
},

Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4529,6 +4529,10 @@ nth-check@~1.0.1:
dependencies:
boolbase "~1.0.0"

null-loader@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/null-loader/-/null-loader-0.1.1.tgz#17be9abfcd3ff0e1512f6fc4afcb1f5039378fae"

num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
Expand Down

0 comments on commit 823b17a

Please sign in to comment.