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
[ ] Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
[ ] Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others should be submitted to master branch)
Types of changes
Background and context
Solution
If using
style-loader
, webpack will requirestyle-loader
in user's node_modules, while usingrequire.resolve('style-loader')
will requirestyle-loader
underarco-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
Checklist:
feature
branch and others should be submitted tomaster
branch)Other information