Failed to find '~photoswipe/dist

2020-01-15  本文已影响0人  仰简

一、问题

在 vue 文件中的 <style></style>用前导符 "~" 引入资源时报错如下

error  in ./src/components/VuePreview/preview.vue
Module build failed: Error: Failed to find '~photoswipe/dist/photoswipe.css'

二、解决

应该在 <script></script> 中引入,且去除前导符 ~ ,如下

import 'photoswipe/dist/photoswipe.css'
import 'photoswipe/dist/default-skin/default-skin.css'

但是,为什么呢?

上一篇 下一篇

猜你喜欢

热点阅读