新しくライブラリを追加した後、ライブラリを呼び出すと以下のエラーが発生
ブラウザのコンソール
Uncaught TypeError: Failed to resolve module specifier "ライブラリ". Relative references must start with either "/", "./", or "../".
Snowpackのコンソール
[snowpack] Import "ライブラリ" could not be resolved. If this is a new package, re-run Snowpack with the --reload flag to rebuild. If Snowpack is having trouble detecting the import, add "install": ["ライブラリ"] to your Snowpack config file.
解決方法
コンソールに表示されている通り、--reload
をつけて起動すれば読み込めるようになりました
Snowpackではnode_modules
からweb_modules
への変換を行ってライブラリを読み込んでいますが、この--reload
が無いとライブラリがビルドされないようでした