Closed a-lba closed 2 months ago
https://github.com/swc-project/swc/issues/7435
Evaluation order of module: "commonjs" is different from tsc. The behavior of tsc is wrong. ESM is an established standard, and the specification explicitly says that ESM imports are hoisted.
When moving from babel-jest to @swc/jest I am getting "ReferenceError: Cannot access 'store' before initialization" error.
swc configuration:
transform: { '^.+\\.jsx?$': [ require.resolve('@swc/jest'), { jsc: { target: 'es2017', parser: { syntax: 'ecmascript', jsx: true, decorators: true, dynamicImport: false, }, transform: { legacyDecorator: true, react: { runtime: 'automatic' } }, }, module: { type: 'commonjs' }, sourceMaps: 'inline' } ] },