Skip to content

Commit

Permalink
Web: Clean up option merging, better default for manifest. (neutrinoj…
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty authored and eliperelman committed Nov 21, 2017
1 parent 1c39203 commit 3dfd20c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions packages/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,24 @@ const { optimize } = require('webpack');
const MODULES = join(__dirname, 'node_modules');

module.exports = (neutrino, opts = {}) => {
const publicPath = './';
const options = merge({
publicPath,
env: [],
hot: true,
html: {},
publicPath: './',
style: {
hot: opts.hot !== false
polyfills: {
async: true
},
devServer: {
hot: opts.hot !== false
hot: opts.hot !== false,
publicPath: resolve('/', publicPath)
},
polyfills: {
async: true
style: {
hot: opts.hot !== false
},
manifest: opts.html === false ? {} : false,
minify: {},
manifest: {},
babel: {},
targets: {}
}, opts);
Expand All @@ -51,11 +53,6 @@ module.exports = (neutrino, opts = {}) => {
};
}

options.devServer = merge({
hot: options.hot !== false,
publicPath: resolve('/', options.publicPath)
}, options.devServer);

if (!options.targets.node && !options.targets.browsers) {
options.targets.browsers = [
'last 2 Chrome versions',
Expand Down Expand Up @@ -177,7 +174,7 @@ module.exports = (neutrino, opts = {}) => {
}]
});

if (options.html === false && options.manifest) {
if (options.manifest) {
neutrino.config.plugin('manifest')
.use(ManifestPlugin, [options.manifest]);
}
Expand Down

0 comments on commit 3dfd20c

Please sign in to comment.