Skip to content

Commit

Permalink
0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Oct 21, 2016
1 parent bd50172 commit 5860b29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
10 changes: 3 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;

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

function devWare(compiler, options) {
function koaDevware(compiler, options) {
var _this = this;

var dev = (0, _webpackDevMiddleware2.default)(compiler, options);
Expand Down Expand Up @@ -90,7 +90,7 @@ function devWare(compiler, options) {
}();
}

function hotWare(compiler, options) {
function koaHotware(compiler, options) {
var _this2 = this;

var hot = (0, _webpackHotMiddleware2.default)(compiler, options);
Expand Down Expand Up @@ -150,11 +150,7 @@ exports.default = function (options) {
options.dev.publicPath = config.output.publicPath;
}

var dev = (0, _webpackDevMiddleware2.default)(compiler, options.dev),
// eslint-disable-line one-var
hot = (0, _webpackHotMiddleware2.default)(compiler, options.hot);

return (0, _koaCompose2.default)([devWare, hotWare]);
return (0, _koaCompose2.default)([koaDevware(compiler, options.dev), koaHotware(compiler, options.dev)]);
};

module.exports = exports['default'];
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import compose from 'koa-compose';
import root from 'app-root-path';
import * as path from 'path';

function devWare (compiler, options) {
function koaDevware (compiler, options) {
const dev = devMiddleware(compiler, options);

return async (ctx, next) => {
Expand All @@ -30,7 +30,7 @@ function devWare (compiler, options) {
};
}

function hotWare (compiler, options) {
function koaHotware (compiler, options) {
const hot = hotMiddleware(compiler, options);

return async (ctx, next) => {
Expand Down Expand Up @@ -68,8 +68,8 @@ export default (options) => {
options.dev.publicPath = config.output.publicPath;
}

const dev = devMiddleware(compiler, options.dev), // eslint-disable-line one-var
hot = hotMiddleware(compiler, options.hot);

return compose([ devWare, hotWare ]);
return compose([
koaDevware(compiler, options.dev),
koaHotware(compiler, options.dev)
]);
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "koa-webpack",
"version": "0.1.1",
"version": "0.1.5",
"description": "Development and Hot Reload Middleware for Koa2",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 5860b29

Please sign in to comment.