split up rollup input and output config to prevent warnings

This commit is contained in:
Bruno Windels 2020-08-07 10:08:08 +02:00
parent 73c0a92377
commit 395bd8e8d4

View File

@ -103,16 +103,12 @@ async function buildHtml(version, bundleName) {
async function buildJs(bundleName) { async function buildJs(bundleName) {
// create js bundle // create js bundle
const rollupConfig = { const bundle = await rollup.rollup({input: 'src/main.js'});
input: 'src/main.js', await bundle.write({
output: { file: path.join(targetDir, bundleName),
file: path.join(targetDir, bundleName), format: 'iife',
format: 'iife', name: 'main'
name: 'main' });
}
};
const bundle = await rollup.rollup(rollupConfig);
await bundle.write(rollupConfig);
} }
async function buildJsLegacy(bundleName) { async function buildJsLegacy(bundleName) {
@ -133,15 +129,14 @@ async function buildJsLegacy(bundleName) {
// create js bundle // create js bundle
const rollupConfig = { const rollupConfig = {
input: 'src/main-legacy.js', input: 'src/main-legacy.js',
output: {
file: path.join(targetDir, bundleName),
format: 'iife',
name: 'main'
},
plugins: [commonjs(), nodeResolve(), babelPlugin] plugins: [commonjs(), nodeResolve(), babelPlugin]
}; };
const bundle = await rollup.rollup(rollupConfig); const bundle = await rollup.rollup(rollupConfig);
await bundle.write(rollupConfig); await bundle.write({
file: path.join(targetDir, bundleName),
format: 'iife',
name: 'main'
});
} }
async function buildOffline(version, bundleName) { async function buildOffline(version, bundleName) {