Skip to content
Snippets Groups Projects
Commit 6baa3cd7 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

rollup: switch to the babel output plugin

Instead of transforming the input we now transform the output. This
has the downside that we can't share the helpers and duplicate them per chunk,
but also makes sure we cover all code that ends up in the bundle.

Also move terser aft er babel, so it gets minified last.
parent 57bab67c
No related branches found
No related tags found
No related merge requests found
Pipeline #14268 passed
......@@ -14,7 +14,7 @@ import consts from 'rollup-plugin-consts';
import license from 'rollup-plugin-license';
import del from 'rollup-plugin-delete';
import emitEJS from 'rollup-plugin-emit-ejs'
import babel from '@rollup/plugin-babel'
import {getBabelOutputPlugin} from '@rollup/plugin-babel';
import selfsigned from 'selfsigned';
// -------------------------------
......@@ -281,7 +281,6 @@ Dependencies:
replace({
"process.env.BUILD": '"' + build + '"',
}),
useTerser ? terser() : false,
copy({
targets: [
{src: 'assets/silent-check-sso.html', dest:'dist'},
......@@ -307,14 +306,7 @@ Dependencies:
{src: 'node_modules/tabulator-tables/dist/css', dest: 'dist/local/@dbp-toolkit/file-handling/tabulator-tables'},
],
}),
useBabel && babel({
include: [
'src/**',
'vendor/**',
'node_modules/pdfjs-dist/**', // uses Promise.allSettled
],
babelHelpers: 'runtime',
babelrc: false,
useBabel && getBabelOutputPlugin({
presets: [[
'@babel/preset-env', {
loose: true,
......@@ -325,15 +317,8 @@ Dependencies:
}
}
]],
plugins: [[
'@babel/plugin-transform-runtime', {
corejs: 3,
useESModules: true
}
],
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-syntax-import-meta']
}),
useTerser ? terser() : false,
watch ? serve({
contentBase: '.',
host: '127.0.0.1',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment