reactjs - Cómo importar archivos .ts en static.config.js en la plantilla de TypeScript de React Static
Tengo un problema al importar archivos .ts en el archivo static.config.js de mi proyecto con React Static. Obtuve este error
Unexpected token { import sth from sth }Cuando cambio mi static.config.js a static.config.ts obtengo un error
=> File changed: /artifacts/react-static-browser-plugins.js
=> Updating build...
Failed to build! Fix any errors and try again!
multi /MY_PROJECT/node_modules/react-dev-utils/webpackHotDevClient.js (webpack)/hot/only-dev-server.js ../lib/bootstrapPlugins.js ../lib/bootstrapTemplates.js /MY_PROJECT/src/index.js
Module not found: Can't resolve '/MY_PROJECT/src/index.js' in '/MY_PROJECT/node_modules/react-static/node_modules'
Mi tsconfig.json
"target": "esnext",
"module": "esnext",
"jsx": "preserve",
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": "./src",
"resolveJsonModule" : true,
"lib": ["dom", "es2015", "es2016"]
}
Qué hacer para poder importar archivos .ts en static.config.js o qué hacer para que static.config.ts funcione?