Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

@ackee/react-scripts@2.0.0

Choose a tag to compare

@cermakjiri cermakjiri released this 23 Apr 12:38
· 122 commits to master since this release

@ackee/react-script@2.0.0

💥 Breaking changes

  1. Add extensions to eslint config:

     "settings": {
        "import/resolver": {
            "node": {
                "paths": ["src"],
    +            "extensions": [".js", ".jsx"]
            }
        }
    },
  2. Replace BUILD_ENV and --target with REACT_APP_BUILD_ENV:

    Update config/config.js:

    - const envConfig = require(`./config.${process.env.BUILD_ENV}.js`).default;
    + const envConfig = require(`./config.${process.env.REACT_APP_BUILD_ENV}.js`).default;

    Update build:* scripts in package.json:

    - "build:development": "react-scripts build --target=development",
    - "build:master": "react-scripts build --target=production",
    - "build:stage": "react-scripts build --target=stage",
    
    + "build:development": "export REACT_APP_BUILD_ENV=development; react-scripts build",
    + "build:stage": "export REACT_APP_BUILD_ENV=stage; react-scripts build",
    + "build:master": "export REACT_APP_BUILD_ENV=production; react-scripts build",

    Update start script in package.json - prepend export REACT_APP_BUILD_ENV=development;:

    - "start": "yarn localize && react-scripts start",
    + "start": "export REACT_APP_BUILD_ENV=development; yarn localize && react-scripts start",

    Update test script/s in package.json - prepend export REACT_APP_BUILD_ENV=test;:

    - "test": "react-scripts test",
    + "test": "export REACT_APP_BUILD_ENV=test; react-scripts test",
  3. Update the eslint config:

    - "extends": ["react-app", "@ackee/eslint-config", "prettier"],
    + "extends": ["@ackee/eslint-config", "prettier"],
  4. Disable FAST_REFRESH for now - it doesn't work
    In .env:

    + FAST_REFRESH=false
  5. Remove EXTEND_ESLINT - it is no longer required to customize the ESLint config
    In .env:

    - EXTEND_ESLINT=false
  6. (Possible breaking change) Jest has been upgraded to v26 and resetMocks: true is set by default.

  7. Remove cypress
    If you're using it in your project, install it manually:

    yarn add cypress@latest eslint-plugin-cypress@latest -D
  8. Upgrade react-scripts@4.0.0 - changelog includes following breaking changes that relates to @ackee/react-script:

  9. Add typescript package (for TypeScript projects only)
    typescript has been move to peerDependencies, so you need to install it manually:

    yarn add typescript -D
  10. Add src/servicer-worker.js or src/servicer-worker.ts

    Starting with Create React App 4, you can add a src/service-worker.js file to your project to use the built-in support for Workbox's InjectManifest plugin, which will compile your service worker and inject into it a list of URLs to precache.
    See more at https://create-react-app.dev/docs/making-a-progressive-web-app/

  11. ⚠️ To prevent unexpected issues, do a clean install as the last step:

rm -rf ./node_modules && yarn

🚀 New features

  • Upgrade @ackee/eslint-config@3.0.0
  • Upgrade worker-plugin@5.0.0
  • Upgrade madge@4.0.2