Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
[removed] webpack.NoErrorsPlugin from DevServer, as it is no longer…
Browse files Browse the repository at this point in the history
… required by `react-hot-loader`
  • Loading branch information
thealjey committed Jul 27, 2016
1 parent f943c89 commit 70c3625
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 29 deletions.
8 changes: 4 additions & 4 deletions docs/DevServer.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h5>Parameters:</h5>
<ul class="dummy">
<li>
<a href="DevServer.js.html">DevServer.js</a>,
<a href="DevServer.js.html#sunlight-1-line-24">line 24</a>
<a href="DevServer.js.html#sunlight-1-line-23">line 23</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -400,7 +400,7 @@ <h4 class="name" id="run"><span class="type-signature"></span>run()</h4>
<ul class="dummy">
<li>
<a href="DevServer.js.html">DevServer.js</a>,
<a href="DevServer.js.html#sunlight-1-line-215">line 215</a>
<a href="DevServer.js.html#sunlight-1-line-214">line 214</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -494,7 +494,7 @@ <h4 class="name" id="watchJS"><span class="type-signature"></span>watchJS()</h4>
<ul class="dummy">
<li>
<a href="DevServer.js.html">DevServer.js</a>,
<a href="DevServer.js.html#sunlight-1-line-158">line 158</a>
<a href="DevServer.js.html#sunlight-1-line-157">line 157</a>
</li>
</ul>
</dd>
Expand Down Expand Up @@ -588,7 +588,7 @@ <h4 class="name" id="watchSASS"><span class="type-signature"></span>watchSASS()<
<ul class="dummy">
<li>
<a href="DevServer.js.html">DevServer.js</a>,
<a href="DevServer.js.html#sunlight-1-line-131">line 131</a>
<a href="DevServer.js.html#sunlight-1-line-130">line 130</a>
</li>
</ul>
</dd>
Expand Down
3 changes: 1 addition & 2 deletions docs/DevServer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ <h1 class="page-title">Source: DevServer.js</h1>
const LIVERELOAD_PORT = 35729,
WEB_PORT = 3000,
cwd = process.cwd(),
{HotModuleReplacementPlugin, NoErrorsPlugin} = webpack,
defaultOptions = {
port: WEB_PORT,
react: true,
Expand Down Expand Up @@ -272,7 +271,7 @@ <h1 class="page-title">Source: DevServer.js</h1>
filename: 'script.js',
publicPath: '/'
},
plugins: [new HotModuleReplacementPlugin(), new NoErrorsPlugin()],
plugins: [new webpack.HotModuleReplacementPlugin()],
module: {
loaders: [{
test: /\.js$/,
Expand Down
2 changes: 1 addition & 1 deletion docs/quicksearch.html

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions lib/DevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ var _serveStatic2 = _interopRequireDefault(_serveStatic);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LIVERELOAD_PORT = 35729;

var WEB_PORT = 3000;
var cwd = process.cwd();
var HotModuleReplacementPlugin = _webpack2.default.HotModuleReplacementPlugin;
var NoErrorsPlugin = _webpack2.default.NoErrorsPlugin;
var defaultOptions = {
var LIVERELOAD_PORT = 35729,
WEB_PORT = 3000,
cwd = process.cwd(),
defaultOptions = {
port: WEB_PORT,
react: true,
contentBase: cwd,
Expand Down Expand Up @@ -82,6 +79,7 @@ var defaultOptions = {
* // now navigate to http://localhost:3000 using your favorite browser ( preferably Chrome :) )
*/


var DevServer = exports.DevServer = function () {

/* eslint-disable require-jsdoc */
Expand Down Expand Up @@ -212,7 +210,7 @@ var DevServer = exports.DevServer = function () {
filename: 'script.js',
publicPath: '/'
},
plugins: [new HotModuleReplacementPlugin(), new NoErrorsPlugin()],
plugins: [new _webpack2.default.HotModuleReplacementPlugin()],
module: {
loaders: [{
test: /\.js$/,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
"babel-preset-es2015-native-modules": "^6.9.2",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-2": "^6.11.0",
"babel-runtime": "^6.9.2",
"babel-runtime": "^6.11.6",
"cheerio": "^0.20.0",
"codemirror": "^5.17.0",
"eslint": "^3.1.1",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-flow-vars": "^0.5.0",
"eslint-plugin-lodash": "^1.10.0",
"eslint-plugin-lodash": "^1.10.1",
"eslint-plugin-react": "^5.2.2",
"fb-watchman": "^1.9.0",
"ink-docstrap": "^1.2.1",
Expand All @@ -91,7 +91,7 @@
"node-sass": "^3.8.0",
"node-sass-import-once": "^1.2.0",
"null-loader": "^0.1.1",
"postcss": "^5.1.0",
"postcss": "^5.1.1",
"react": "^15.2.1",
"react-hot-loader": "^1.3.0",
"remarkable": "^1.6.2",
Expand All @@ -108,7 +108,7 @@
"mt-changelog": "^0.6.2",
"proxyquire": "^1.7.10",
"release-script": "^1.0.2",
"sinon": "^1.17.4",
"sinon": "^1.17.5",
"sinon-chai": "^2.8.0"
}
}
3 changes: 1 addition & 2 deletions src/DevServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import serveStatic from 'serve-static';
const LIVERELOAD_PORT = 35729,
WEB_PORT = 3000,
cwd = process.cwd(),
{HotModuleReplacementPlugin, NoErrorsPlugin} = webpack,
defaultOptions = {
port: WEB_PORT,
react: true,
Expand Down Expand Up @@ -181,7 +180,7 @@ export class DevServer {
filename: 'script.js',
publicPath: '/'
},
plugins: [new HotModuleReplacementPlugin(), new NoErrorsPlugin()],
plugins: [new webpack.HotModuleReplacementPlugin()],
module: {
loaders: [{
test: /\.js$/,
Expand Down
8 changes: 2 additions & 6 deletions test/DevServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {spy, stub, match} from 'sinon';
import sinonChai from 'sinon-chai';
import proxyquire from 'proxyquire';
import {SASSCompiler} from '../src/SASSCompiler';
import {WebpackDevServer, Server, HotModuleReplacementPlugin, NoErrorsPlugin, webpackApp} from './mock';
import {WebpackDevServer, Server, HotModuleReplacementPlugin, webpackApp} from './mock';
import noop from 'lodash/noop';

chai.use(sinonChai);
Expand All @@ -32,7 +32,6 @@ describe('DevServer', () => {
send = spy();
watch = spy();
webpack.HotModuleReplacementPlugin = HotModuleReplacementPlugin;
webpack.NoErrorsPlugin = NoErrorsPlugin;
stub(SASSCompiler.prototype, 'fe').callsArg(2);
spy(SASSCompiler.prototype.fe, 'bind');
spy(WebpackDevServer.prototype, 'use');
Expand Down Expand Up @@ -274,10 +273,7 @@ describe('DevServer', () => {
filename: 'script.js',
publicPath: '/'
},
plugins: [
match.instanceOf(HotModuleReplacementPlugin),
match.instanceOf(NoErrorsPlugin)
],
plugins: [match.instanceOf(HotModuleReplacementPlugin)],
module: {
loaders: [{
test: /\.js$/,
Expand Down
2 changes: 0 additions & 2 deletions test/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ Server.prototype.listen = noop;

export class HotModuleReplacementPlugin {}

export class NoErrorsPlugin {}

export class DefinePlugin {}

export class OccurrenceOrderPlugin {}
Expand Down

0 comments on commit 70c3625

Please sign in to comment.