Skip to content

Commit

Permalink
Merge pull request #1718 from SUI-Components/feat/react-18-test
Browse files Browse the repository at this point in the history
feat(packages/sui-test): update react aliases
  • Loading branch information
andresz1 authored Feb 1, 2024
2 parents e4ae665 + d7ccb29 commit 8118332
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/sui-test/bin/karma/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ const {bundlerConfig, clientConfig, isWorkspace} = require('../../src/config.js'
const {captureConsole = true} = clientConfig
const {sep} = path

const mustPackagesToAlias = {
'react/jsx-dev-runtime': 'react/jsx-dev-runtime.js',
'react/jsx-runtime': 'react/jsx-runtime.js'
}

/**
* Transform the env config (Array) to an object.
* Where the value is always an empty string.
*/
const environmentVariables = envVars(bundlerConfig.env)
const prefix = isWorkspace() ? '../' : './'
const pwd = process.env.PWD

const config = {
singleRun: true,
Expand Down Expand Up @@ -54,10 +51,9 @@ const config = {
stats: 'errors-only',
resolve: {
alias: {
...mustPackagesToAlias,
'@s-ui/react-context': path.resolve(
path.join(process.env.PWD, isWorkspace() ? '../' : './', 'node_modules/@s-ui/react-context')
)
'react/jsx-dev-runtime': path.resolve(pwd, prefix, 'node_modules/react/jsx-dev-runtime.js'),
'react/jsx-runtime': path.resolve(pwd, prefix, 'node_modules/react/jsx-runtime.js'),
'@s-ui/react-context': path.resolve(path.join(pwd, prefix, 'node_modules/@s-ui/react-context'))
},
modules: [path.resolve(process.cwd()), 'node_modules'],
extensions: ['.mjs', '.js', '.jsx', '.json'],
Expand Down

0 comments on commit 8118332

Please sign in to comment.