Skip to content

Commit

Permalink
fix bundle for demos
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Oct 4, 2018
1 parent d1664cc commit f61b64e
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions webpack.config.js
Expand Up @@ -22,12 +22,7 @@ module.exports = (env, options) => {
const dev = options.mode.startsWith('d');
const config = {
node: false, // no polyfills
entry: dev ? {
LineUpJSx: './src/index.tsx',
builder2: './demo/builder2.tsx',
builder3: './demo/builder3.tsx',
highlight: './demo/highlight.tsx'
} : {
entry: {
LineUpJSx: './src/index.tsx'
},
output: {
Expand Down Expand Up @@ -152,17 +147,17 @@ module.exports = (env, options) => {
}
};

if (dev) {
return config;
}

// create a bundled version, too
const bundle = Object.assign({}, config);
bundle.entry = {
'LineUpJSx.bundle': './src/index.tsx'
}
bundle.externals = Object.assign({}, config.externals);
delete bundle.externals.lineupjs;

bundle.entry = dev ? {
builder2: './demo/builder2.tsx',
builder3: './demo/builder3.tsx',
highlight: './demo/highlight.tsx'
}: {
'LineUpJSx.bundle': './src/index.tsx'
};

return [config, bundle];
};

0 comments on commit f61b64e

Please sign in to comment.