-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve the build using rollup #882
base: main
Are you sure you want to change the base?
Conversation
6ee931c
to
bf35d75
Compare
I think extracting the rollup configs and having another package is ok, I would call it |
@goosewobbler The part what increases the amount of source code is following functionality.
|
Description
To avoid complications of ESM and CJS build, Implement
rollup
as bundler.We created new package
@wdio/electron-bundler
because there are some logic to create rollup configurations.This could be achieved by simply creating a common configuration file and use from each package, but we packaged it to improve the quality of the entire library by introducing a unit test for the logic that creates the
rollup
configuration itself.Core motivation
we have to set aligned value between
output.dir
of the rollup option andout Dir
of the typescript option.Specifically, the path of typescript compiler option 'outdir' must be located inside rollup 'dir' option.
To create a library that supports both CJS and ESM, the source code for each format needs to be stored in separate directories.(when not use
cjs
,mjs
) This means different paths must be specified for output.dir in the Rollup configuration.So, new package is created to genelate the rollup programmatically.
*) related info
Feature
The
input
parameter is automatically created based onexports
field ofpackage,json
Reduce the effort of synchronizing package.json settings and Rollup settings.
Create parameters that enable ESM and CJS style output.
Synchronizes
@rollup-plugin-typescript
settings withrollup
settings and enables output of*.d.ts
files.Related Issue
#880
@goosewobbler
Since this is a major modification, I would appreciate it if you could give me your frank opinions on whether or not to create a new package, and on the following structural changes for
dist
.