Closed
Description
Hey! First off thanks for making this great library!
I just tried upgrading filesize
from v9 to v10.
After changing my imports from:
import filesize from 'filesize'
to:
import { filesize } from 'filesize'
I thought things would work, but when I ran my app, I saw the following webpack error when visiting my site:
export 'filesize' (imported as 'filesize') was not found in 'filesize' (module has no exports)
I was able to "fix" the issue by adding the following resolve alias to my webpack config:
resolve: {
alias: {
filesize: require.resolve('filesize'),
},
},
My project is using typescript, and I think a fairly standard webpack setup.
I did a little searching, and I've seen a few people mention that changing the "browser" field from a string to a map might force webpack to pick the "module" over the "browser" field?
I think my build was using the browser field by default and that doesn't have exports?
Metadata
Metadata
Assignees
Labels
No labels