element-plus / unplugin-element-plus

🔌 Import Element Plus on demand. Support Vite, Webpack, Vue CLI, Rollup and esbuild.

Home Page:https://unplugin.element-plus.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

使用vue-cli + unplugin-element-plus手动按需引入样式并自定义主题后,打包报错

daiwanxing opened this issue · comments

commented
Syntax Error: SassError: @forward rules must be written before any other rules.
  ╷
5 │ @forward './date-picker/date-table.scss';
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

我想自定义element-plus主题样式,按照example文件夹下给的例子
unpluginElementPlus({ useSource: true, }),
给useSource设置true后出现如上错误,不知为何,尝试不导入date-picker组件后,可以打包成功并能正常覆盖默认主题

Can you provide a reusable example?
I tried to import the date-picker but didn't report a mistake.

I add date-picker in examples, and it works. See a493f38.

Did you use @import in your sass? Try @use, @import will be deprecated in sass.

commented

ok,I got this problem on my company project (when I upgrade element-plus 1.0.* to latest), I try to make a simple example to reproduce it but the simple example work fine. so I think maybe my project some dependencies version too old or conflict. In any case, thanks your point ! I will close this issue.