Skip to content

Commit

Permalink
Merge pull request #61 from digitalfabrik/use-es2020
Browse files Browse the repository at this point in the history
Use ES2020 for better compatibility
  • Loading branch information
michael-markl authored Dec 27, 2023
2 parents 635b5a2 + 4aa6c71 commit a295acc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ The component generally supports:
* Safari >= 6.2

However, if you want to support non-modern browsers, you are responsible for transpiling the code for your preferred target.
The distributed files on npm are transpiled for ES2020.


For hiding and revealing the header, the browser needs to support the css-property `position: sticky`.
You can read about the browser support for that on [caniuse.com](https://caniuse.com/#feat=css-sticky).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@integreat-app/react-sticky-headroom",
"version": "2.1.0",
"version": "2.2.0",
"engines": {
"node": ">=18",
"npm": ">=10"
Expand Down
4 changes: 2 additions & 2 deletions tools/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function compile (fileNames: string[], options: CompilerOptions): Record<string,
type: 'es6'
},
jsc: {
target: 'es2022',
target: 'es2020',
experimental: {
plugins: [
[
Expand Down Expand Up @@ -102,7 +102,7 @@ function compile (fileNames: string[], options: CompilerOptions): Record<string,
type: 'commonjs'
},
jsc: {
target: 'es2022',
target: 'es2020',
experimental: {
plugins: [
[
Expand Down
3 changes: 1 addition & 2 deletions tools/demo.webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const webpackConfig: webpack.Configuration = {
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules\/.*/,
test: /\.tsx?|\.js$/,
loader: 'swc-loader',
options: {
jsc: {
Expand Down

0 comments on commit a295acc

Please sign in to comment.