arco-design / arco-cli

CLI tool for Arco Design
https://arco.design/docs/material/guide
MIT License
203 stars 76 forks source link

Fix: webpack loader in webpack config should wrap `require.resolve` #44

Closed lianghx-319 closed 1 year ago

lianghx-319 commented 1 year ago

Types of changes

Background and context

Solution

If using style-loader, webpack will require style-loader in user's node_modules, while using require.resolve('style-loader') will require style-loader under arco-scripts/node_modules

It is the same as create-react-app's webpack config https://github.com/facebook/create-react-app/blob/f34d88e30c7d8be7181f728d1abc4fd8d5cd07d3/packages/react-scripts/config/webpack.config.js#L130

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues

Checklist:

Other information