Skip to content

Commit

Permalink
Fix browser bundling with webpack 5
Browse files Browse the repository at this point in the history
I think that the browser field is missing `url: false`.
I'm not completely sure that this is the right fix and also the npm package `url` does not implement the APIs used by postcss. 

steps to reproduce

```
mkdir postcss-browser 
cd postcss-browser 
mkdir src
echo 'import "postcss";' > src/index.js
npm init -y
npm install webpack webpack-cli postcss
npx webpack
```
This will emit error: 
```
ERROR in ./node_modules/postcss/lib/input.js 3:39-53
Module not found: Error: Can't resolve 'url' in 'C:\projects\postcss-web-bundle\postcss-browser\node_modules\postcss\lib'
```
  • Loading branch information
barak007 committed Apr 8, 2021
1 parent 8682b1e commit a54d020
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"./lib/terminal-highlight": false,
"colorette": false,
"fs": false,
"path": false
"path": false,
"url": false
},
"size-limit": [
{
Expand Down

0 comments on commit a54d020

Please sign in to comment.