Comments (17)
vite场景配置 whiteList: [/swiper/]
from ssr.
顺便这里建议一下不要用import 'swiper/css'
改为 import 'swiper/swiper.min.css'
。以适配webpack4以及更好的兼容性
from ssr.
那你继续用这种写法吧,webpack4不支持package.json export,或者换成example用的6.x版本的swiper
from ssr.
whitelist添加/swiper.css/
from ssr.
下面是 swiper 的结构目录
以及 swiper 的 package.json
from ssr.
新搭建的项目,确定错误就在
import "swiper/css";
删掉这行就好了
from ssr.
仔细阅读文档
whiteList:[/swiper.css/]
不要新增rule
from ssr.
我看了下文档,我理解 whiteList的作用,然后我把刚把cssOptions 这块儿删了,并且新增了 whiteList: [/swiper.css/]。重新启动项目,依然还是这个错误。不知道是不是我理解错了你的意思,加错地方了?
from ssr.
@zhangyuang 那你也泰裤辣,解决了。
from ssr.
OK OK 感谢感谢
from ssr.
大佬 本来不想打搅你的,不过发现 npm run start:vite 执行没问题,但是 npm run prod 会提示
还是这个配置 config.ts
whiteList: [/swiper/]
还是这样的引入
这些都没变
@zhangyuang
from ssr.
我知道问题了, 需要加入 ssr build --vite 之前是 ssr build .
from ssr.
上面说了改引入方式啊
from ssr.
我改了引入方式 会报错。因为项目比较急 我就没有过度纠结这个问题,等下我改一下 给你看看
from ssr.
在只改变引入方式的情况下
config.ts 如下
whiteList: [/swiper/],
执行 npm run start:vite 会出现如下问题
如果执行 npm run start
则会出现更多的其他问题,因为我们项目已经在迭代中了,所以不能再回头大幅修改引入方式。所以只能这样了 @zhangyuang 再次感谢
from ssr.
swiper/vue的引入方式也改啊
from ssr.
可是我想用 vite 。 npm run start:vite 会出现 Missing "./swiper.min.css" export in "swiper" package
我偏向于 vite 启动整个环节都是 vite,以后再用您的项目模板也会这样。
from ssr.
Related Issues (20)
- vite编译超时 HOT 3
- 怎么引入element-plus HOT 14
- 通过 less loader 配置的 less 变量不生效 HOT 5
- 请问有没有 egg的服务端插件? 如果没有,后端想使用egg,该怎么做呢,谢谢。 HOT 5
- 访问未定义的路由时,server端代码报错
- 生产环境的antdv ui css 样式和开发环境不一致 HOT 4
- 请问启动后,isBrower找不到,编译报错怎么解决?谢谢 HOT 2
- npx ssr build --html 编译出错 HOT 1
- 使用midway-vue3-ssr模版在组件中访问public下的静态资源404 HOT 3
- antd5新版本的兼容性问题
- 新版本antd5兼容性问题 HOT 4
- ssr-plugin-react 新版本缺少src路径
- build:o 相关问题 HOT 9
- Pm2模式下, Require() of ES Module 报错 HOT 2
- AuthProvider? HOT 4
- 通过vite方式引入windiCSS失败 HOT 2
- Webpack IgnorewPlugin HOT 1
- 请教下如何将node_module依赖构建到产物中,从而减少远端部署文件大小 HOT 1
- 渲染的数据量多就会报错state undefined的情况 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssr.