-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
96 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@itwin/itwinui-react': minor | ||
--- | ||
|
||
Replaced dependency on `tslib` with `@swc/helpers`. This is used mainly by the CommonJS build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@itwin/itwinui-react': patch | ||
--- | ||
|
||
The build output is now (again) formatted using `prettier` for easier debugging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@itwin/itwinui-react': patch | ||
--- | ||
|
||
Removed all code comments from the build output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import { execSync } from 'node:child_process'; | ||
|
||
// https://swc.rs/docs/usage/cli | ||
const swcOptions = { | ||
shared: [ | ||
'--strip-leading-paths', | ||
'--no-swcrc', | ||
'--ignore **/*.test.*,**/styles.js/*,**/styles*', | ||
].join(' '), | ||
|
||
// https://swc.rs/docs/configuration/compilation | ||
compilerOptions: [ | ||
'', | ||
'jsc.parser.syntax=typescript', | ||
'jsc.parser.tsx=true', | ||
'jsc.transform.react.useBuiltins=true', | ||
'jsc.target=es2020', | ||
'jsc.minify.format.comments=false', | ||
'jsc.externalHelpers=true', | ||
].join(' -C '), | ||
|
||
get esm() { | ||
return [this.shared, this.compilerOptions, '-C module.type=es6'].join(' '); | ||
}, | ||
|
||
get cjs() { | ||
return [this.shared, this.compilerOptions, '-C module.type=commonjs'].join( | ||
' ', | ||
); | ||
}, | ||
}; | ||
|
||
execSync(`pnpm swc src -d esm ${swcOptions.esm}`); | ||
console.log('✓ Built esm.'); | ||
|
||
execSync(`pnpm swc src -d cjs ${swcOptions.cjs}`); | ||
console.log('✓ Built cjs.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.