Skip to content

Commit

Permalink
changed saucelabs to use SWC and babel and ts configs to ES2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Jan 24, 2025
1 parent 60f4d03 commit 87bfa03
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 114 deletions.
44 changes: 24 additions & 20 deletions fixtures/browser/karma.babel.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,30 @@ module.exports = function (config) {
module: {
rules: [
{
test: /\.(ts|tsx|js|jsx)$/,
exclude: /(node_modules)/,
use: {
loader: 'swc-loader',
options: {
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true,
},
"experimental": {
"plugins": [
["swc-plugin-inferno", {}]
],
},
"target": "es2022",
"loose": true
}
}
},
test: /\.(js|jsx|tsx|ts)$/,
loader: path.join(__dirname, 'node_modules/babel-loader'),
options: {
babelrc: false,
presets: [
'@babel/typescript',
[
'@babel/preset-env',
{
loose: true,
// es2022
"targets": [
"chrome >= 107",
"firefox >= 105",
"edge >= 107"
]
}
]
],
plugins: [
['babel-plugin-inferno', { imports: true }],
['@babel/plugin-proposal-class-properties', { loose: true }]
]
}
}
]
},
Expand Down
41 changes: 20 additions & 21 deletions fixtures/browser/karma.sauce.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,26 @@ module.exports = function (config) {
module: {
rules: [
{
test: /\.(js|jsx|tsx|ts)$/,
loader: path.join(__dirname, 'node_modules/babel-loader'),
options: {
babelrc: false,
presets: [
[
'@babel/preset-env',
{
loose: true,
targets: {
firefox: '90'
}
}
],
'@babel/typescript'
],
plugins: [
['babel-plugin-inferno', { imports: true }],
['@babel/plugin-proposal-class-properties', { loose: true }]
]
}
test: /\.(ts|tsx|js|jsx)$/,
exclude: /(node_modules)/,
use: {
loader: 'swc-loader',
options: {
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true,
},
"experimental": {
"plugins": [
["swc-plugin-inferno", {}]
],
},
"target": "es2022",
"loose": true
}
}
},
}
]
},
Expand Down
10 changes: 6 additions & 4 deletions fixtures/browser/karma.ts.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ module.exports = function (config) {
'@babel/preset-env',
{
loose: true,
targets: {
ie: '11',
safari: '8'
}
// es2022
"targets": [
"chrome >= 107",
"firefox >= 105",
"edge >= 107"
]
}
],
'@babel/typescript'
Expand Down
Loading

0 comments on commit 87bfa03

Please sign in to comment.