Skip to content

Commit a54d020

Browse files
author
barak igal
authored
Fix browser bundling with webpack 5
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' ```
1 parent 8682b1e commit a54d020

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
"./lib/terminal-highlight": false,
104104
"colorette": false,
105105
"fs": false,
106-
"path": false
106+
"path": false,
107+
"url": false
107108
},
108109
"size-limit": [
109110
{

0 commit comments

Comments
 (0)