Skip to content
Snippets Groups Projects
Commit 6d7501f8 authored by Andreas Nedbal's avatar Andreas Nedbal Committed by Benjamin Franzke
Browse files

[TASK] Update rollup to 4.17.2

Newer rollup major versions feature optimizations in build output.

The rollup source files are now natively parsed as ESM modules by
NodeJS. Earlier rollup versions implicitly transpiled ESM to CJS and
allowed a mixture of ESM and CJS imports (both `import` statements and
`require()` calls) in one module.

With the switch to ESM-only modules we now make use of `createRequire`
utility method when node-require resolution is needed for CJS path
lookups. Since our main project (Build/) is still in CJS mode by default
(for grunt), we apply a sub-project module type overwrite for the
Build/rollup/ folder via Build/rollup/package.json to ensure rollup
configuration runs in native ESM mode.

See https://nodejs.org/docs/latest-v18.x/api/packages.html
> Node.js will treat the following as ES modules when passed to node as
> the initial input, or when referenced by import statements or import()
> expressions:
> […]
> * Files with a .js extension when the nearest parent package.json file
>   contains a top-level "type" field with a value of "module".

Executed commands:

    npm install --save-dev \
        rollup@^4.17.2 \
        @rollup/plugin-commonjs@^25.0.7 \
        @rollup/plugin-node-resolve@^15.2.3 \
        @rollup/plugin-replace@^5.0.5
    npm run build -- exec:rollup

Resolves: #103775
Releases: main, 12.4
Change-Id: I6793bd9233b2907ce5ed06d68c7008b349237360
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84102


Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
parent d2aa61e3
Branches
Tags
No related merge requests found
Showing
with 232 additions and 305 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment