Giter Club home page Giter Club logo

Comments (2)

ShuiRuTian avatar ShuiRuTian commented on September 25, 2024

I would argue it's not this plugin's fault.

This plugin will change the config file.

Before the change, configuration.module.rules[1].oneOf[3] is like

    {
      "test": {},
      "include": "D:\\MyRepo\\webpack-analyze-plugin\\packages\\test-craco-1\\src",
      "loader": "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]_@[email protected][email protected]\\node_modules\\babel-loader\\lib\\index.js",
      "options": {
        "customize": "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\babel-preset-react-app\\webpack-overrides.js",
        "presets": [
          [
            "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\babel-preset-react-app\\index.js",
            {
              "runtime": "automatic"
            }
          ]
        ],
        "babelrc": false,
        "configFile": false,
        "cacheIdentifier": "development:[email protected]:[email protected]:[email protected]:[email protected]",
        "plugins": [
          "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\react-refresh\\babel.js"
        ],
        "cacheDirectory": true,
        "cacheCompression": false,
        "compact": false
      }
    },

After the change of this plugin it's

    {
      "test": {},
      "include": "D:\\MyRepo\\webpack-analyze-plugin\\packages\\test-craco-1\\src",
      "use": [
        "D:\\MyRepo\\webpack-analyze-plugin\\packages\\time-analytics-webpack-plugin\\dist\\loader.js",
        {
          "loader": "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]_@[email protected][email protected]\\node_modules\\babel-loader\\lib\\index.js",
          "options": {
            "customize": "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\babel-preset-react-app\\webpack-overrides.js",
            "presets": [
              [
                "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\babel-preset-react-app\\index.js",
                {
                  "runtime": "automatic"
                }
              ]
            ],
            "babelrc": false,
            "configFile": false,
            "cacheIdentifier": "development:[email protected]:[email protected]:[email protected]:[email protected]",
            "plugins": [
              "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected]\\node_modules\\react-refresh\\babel.js"
            ],
            "cacheDirectory": true,
            "cacheCompression": false,
            "compact": false
          }
        }
      ]
    },

It's a valid config, however, when it's finally consumed by webpack, it becomes:

        {
            "test": {},
            "include": "D:\\MyRepo\\webpack-analyze-plugin\\packages\\test-craco-1\\src",
            "use": [
                "D:\\MyRepo\\webpack-analyze-plugin\\packages\\time-analytics-webpack-plugin\\dist\\loader.js",
                {
                    "test": {},
                    "include": [
                        "D:\\MyRepo\\webpack-analyze-plugin\\packages\\test-craco-1\\src"
                    ],
                    "loader": "D:\\MyRepo\\webpack-analyze-plugin\\node_modules\\.pnpm\\[email protected][email protected]\\node_modules\\esbuild-loader\\dist\\index.js",
                    "options": {
                        "loader": "jsx",
                        "target": "es2015"
                    }
                }
            ]
        },

It's more like the issue of "craco-esbuild", in my personal view.

from time-analytics-webpack-plugin.

ShuiRuTian avatar ShuiRuTian commented on September 25, 2024

And I would suggest not use create-react-app if you are starting a new project.

  • it's heavy, with many functions you might not want.
  • hard to config. So people need craco, but it introduces some strange issue, like this.
  • the developers seems lost interest to maintain it regularly, last commit is 9/8/2022, it's kind of surprised for a project with almost 100k stars.

But it's still pretty good to test for a prototype :P

from time-analytics-webpack-plugin.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.