mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
This adds basic intellisense for code completion and function signatures using the Python `jedi` package running in a Pyodide environment.
37 lines
712 B
JavaScript
37 lines
712 B
JavaScript
'use strict';
|
|
|
|
const babelJest = require('babel-jest').default;
|
|
|
|
const hasJsxRuntime = (() => {
|
|
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
|
return false;
|
|
}
|
|
|
|
try {
|
|
require.resolve('react/jsx-runtime');
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
})();
|
|
|
|
module.exports = babelJest.createTransformer({
|
|
plugins: [
|
|
['@babel/plugin-transform-typescript', {
|
|
allowDeclareFields: true
|
|
}],
|
|
'@shopify/react-i18n/babel',
|
|
"babel-plugin-transform-import-meta",
|
|
],
|
|
presets: [
|
|
[
|
|
require.resolve('babel-preset-react-app'),
|
|
{
|
|
runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
|
},
|
|
],
|
|
],
|
|
babelrc: false,
|
|
configFile: false,
|
|
});
|