简体   繁体   中英

Can next.js and React.js work without Webpack?

Do you know how my configuration is working without webpack installed? This configuration was originally made only to practice tests with Jest but the command "npm run dev" succeed to print a page. Is it a coincidence based on my code, my browser?

"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^0.24.0",
    "fetch": "^1.1.0",
    "next": "10.1.3",
    "node-fetch": "^3.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "@babel/preset-env": "^7.13.12",
    "@babel/preset-typescript": "^7.13.0",
    "@testing-library/dom": "^7.30.3",
    "@testing-library/jest-dom": "^5.11.10",
    "@testing-library/react": "^11.2.6",
    "@types/node": "^14.14.37",
    "@types/react": "^17.0.3",
    "babel-jest": "^26.6.3",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^26.6.3",
    "jest-cli": "^26.6.3",
    "jest-dom": "^4.0.0",
    "jest-svg-transformer": "^1.0.0",
    "react-test-renderer": "^17.0.2",
    "ts-jest": "^27.1.2",
    "ts-node": "^9.1.1",
    "typescript": "^4.2.3"
  }
}

Thanks for your help.

Next.js have internal config files for such cases. I think you can check next.config.js file to see the webpack configuration.

Have a look at this link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM