Configure builds so they actually work
This commit is contained in:
@@ -2,7 +2,7 @@ import TerserPlugin from 'terser-webpack-plugin';
|
||||
import path from 'path';
|
||||
|
||||
export default {
|
||||
entry: './build/index.js',
|
||||
entry: ['regenerator-runtime/runtime', './build/index.js'],
|
||||
devtool: 'source-map',
|
||||
mode: 'production',
|
||||
target: ['web', 'es5'],
|
||||
@@ -13,7 +13,14 @@ export default {
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [['@babel/preset-env', {targets: 'ie 11'}]],
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: 'last 2 versions, not dead',
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
.filter((name) => /^(?!index).*\.html$/.test(name))
|
||||
.map((name) => name.replace(/\.html$/, ''))
|
||||
.forEach((example) => {
|
||||
entry[example] = `./${example}.js`;
|
||||
entry[example] = ['regenerator-runtime/runtime', `./${example}.js`];
|
||||
});
|
||||
return entry;
|
||||
},
|
||||
@@ -30,7 +30,9 @@ export default {
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [['@babel/preset-env', {targets: 'ie 11'}]],
|
||||
presets: [
|
||||
['@babel/preset-env', {targets: 'last 2 versions, not dead'}],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ async function build(input, {minify = true} = {}) {
|
||||
'@babel/preset-env',
|
||||
{
|
||||
'modules': false,
|
||||
'targets': 'last 2 version, not dead',
|
||||
'targets': 'last 2 versions, not dead',
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user