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
Havunen committed Jan 24, 2025
1 parent 60f4d03 commit 87bfa03
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
@@ -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 }]
]
}
}
]
},
41 changes: 20 additions & 21 deletions fixtures/browser/karma.sauce.conf.js
Original file line number Diff line number Diff line change
@@ -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
}
}
},
}
]
},
10 changes: 6 additions & 4 deletions fixtures/browser/karma.ts.conf.js
Original file line number Diff line number Diff line change
@@ -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'
145 changes: 76 additions & 69 deletions fixtures/browser/package-lock.json

0 comments on commit 87bfa03

Please sign in to comment.