#544·craco

EEXIST: file already exists, mkdir ...

Author: zhourenguiCreated Sep 6, 2024Updated Sep 6, 2024
Labelsbug

What's happening An error will be reported when there is a BUILD file in the root directory.

What should happen When my output is no longer a build file, I don’t need to detect it or just don’t detect it. Is it better if the default compiled file is dist?

To reproduce Store BUILD files in the root directory

CRACO version 7.1.0

CRACO config

javascript
import * as path from "path";

export default {
  webpack: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
    output: "dist",
  },

  devServer: {
    proxy: {
      "/api/v1": {
        target: "http://localhost:8888",
        changeOrigin: true,
      },
    },
  },
};

package.json

jsonc
{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.18.108",
    "@types/react": "^18.3.5",
    "@types/react-dom": "^18.3.0",
    "axios": "^1.7.5",
    "clsx": "^2.1.1",
    "daisyui": "^4.12.10",
    "google-protobuf": "^3.21.4",
    "jotai": "^2.9.3",
    "lodash": "^4.17.21",
    "long": "^5.2.3",
    "luxon": "^3.5.0",
    "react": "^18.3.1",
    "react-canvas-draw": "^1.2.1",
    "react-colorful": "^5.6.1",
    "react-dom": "^18.3.1",
    "react-dropzone": "^14.2.3",
    "react-hook-form": "^7.53.0",
    "react-player": "^2.16.0",
    "react-router-dom": "^6.26.1",
    "react-scripts": "5.0.1",
    "react-sortablejs": "^6.1.4",
    "react-use": "^17.5.1",
    "ts-protoc-gen": "^0.15.0",
    "typescript": "^4.9.5",
    "uuid": "^10.0.0",
    "web-vitals": "^2.1.4"
  },
  "devDependencies": {
    "@craco/craco": "^7.1.0",
    "@tailwindcss/typography": "^0.5.14",
    "@types/google-protobuf": "^3.15.12",
    "@types/luxon": "^3.4.2",
    "@types/react-canvas-draw": "^1.2.3",
    "@types/uuid": "^10.0.0",
    "autoprefixer": "^10.4.20",
    "axios-logger": "^2.8.1",
    "globals": "^15.9.0",
    "postcss": "^8.4.41",
    "tailwindcss": "^3.4.10",
    "tailwindcss-animate": "^1.0.7"
  },
  "scripts": {
    "dev": "npx craco start",
    "build": "./scripts/build.sh",
    "test": "npx craco test",
    "eject": "npx craco eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Additional information

My project uses Bazel and the build file is named BUILD. All two frameworks conflict.