Skip to content

Commit

Permalink
Allow no publicPath or entry point (#1310)
Browse files Browse the repository at this point in the history
* fix(addDevServerEntrypoints): allow no entry point to be given

* test(entry): ensure src is added as default if no entry specified
  • Loading branch information
ryanclark authored and SpaceK33z committed Feb 17, 2018
1 parent 9852a5f commit e603e0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/addDevServerEntrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptio
} else if (typeof wpOpt.entry === 'function') {
wpOpt.entry = wpOpt.entry(devClient);
} else {
wpOpt.entry = devClient.concat(wpOpt.entry);
wpOpt.entry = devClient.concat(wpOpt.entry || './src');
}
});
}
Expand Down
18 changes: 18 additions & 0 deletions test/Entry.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const assert = require('assert');
const addDevServerEntrypoints = require('../lib/util/addDevServerEntrypoints');

describe('Entry', () => {
it('default to src if no entry point is given', (done) => {
const webpackOptions = {};
const devServerOptions = {};

addDevServerEntrypoints(webpackOptions, devServerOptions);

assert(webpackOptions.entry.length, 2);
assert(webpackOptions.entry[1], './src');

done();
});
});

0 comments on commit e603e0d

Please sign in to comment.