chantastic / react-svg-spinner

An SVG spinner component

Home Page:http://chantastic.org/react-svg-spinner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Published package.json has incorrect umd / module paths

fdidron opened this issue · comments

While migrating an app that uses this package from CRA to snowpack, I'm getting the following error:

We resolved "react-svg-spinner" to ./node_modules/react-svg-spinner/dist/foo.mjs, but the file does not exist on disk.

Looking at the package.json in my node_modules folder, it seems that the package.json has incorrect fields:

  ...
  "umd:main": "dist/foo.umd.js",
  "module": "dist/foo.mjs",
  ...

I'm guessing those are default values set by microbundle and maybe need some fixing when publishing the package on npm ?

Oh and a workaround if anyone wants to use this nice package with snowpack, add an alias in snowpack.config.js

module.exports = {
  alias: {                                                                                                                                      
    "react-svg-spinner": "./node_modules/react-svg-spinner/dist/index.umd.js"
  }
}