Fix babel config being loaded by vite
This commit is contained in:
@@ -12,11 +12,20 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/** @type {import('@babel/core').TransformOptions} */
|
||||
module.exports = {
|
||||
presets: [
|
||||
["@babel/preset-env", { targets: { node: "current" } }],
|
||||
["@babel/preset-react", { runtime: "automatic" }],
|
||||
"@babel/preset-typescript",
|
||||
],
|
||||
/** @type {import('@babel/core').ConfigFunction} */
|
||||
module.exports = (api) => {
|
||||
// For some reason, `vite-plugin-realy` loads the babel config.
|
||||
// This ensures we only really do transforms when loaded for Jest
|
||||
if (api.env("test")) {
|
||||
return {
|
||||
plugins: ["relay"],
|
||||
presets: [
|
||||
["@babel/preset-env", { targets: { node: "current" } }],
|
||||
["@babel/preset-react", { runtime: "automatic" }],
|
||||
"@babel/preset-typescript",
|
||||
],
|
||||
};
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
3511
frontend/package-lock.json
generated
3511
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,7 @@
|
||||
"@types/relay-runtime": "^14.1.4",
|
||||
"@vitejs/plugin-react": "^2.2.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"babel-plugin-relay": "^14.1.0",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-config-react-app": "^7.0.1",
|
||||
|
||||
Reference in New Issue
Block a user