Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js路径和css路径必须都是基于libDir的变量控制,能否分开 #47

Open
diandian18 opened this issue Apr 10, 2019 · 3 comments

Comments

@diandian18
Copy link

diandian18 commented Apr 10, 2019

能否使js路径基于/lib,而css/scss路径基于非lib的路径,比如packages,thx!
用于支持自定义主题的按需引入(引入变量方式)
Converts

import { Button } from 'element-ui'

To

var button = require('element-ui/lib/button')
require('element-ui/packages/theme-chalk/src/button.scss')
@light0x00
Copy link

相同的问题!
自定义主题的时候,会把lib下的css打包

@light0x00
Copy link

light0x00 commented Aug 10, 2019

我找到了解决方案,只需要像下面这样设置. 代码中正常导入自定义主题scss文件就好了

"plugins": [
    [
      "component",
      {
        "libraryName": "element-ui",
        "style":false
      }
    ]
  ]

@yolofit
Copy link

yolofit commented Aug 3, 2021

试试在目录前加~

 [
    "component",
    {
    "libraryName": "element-ui",
    "styleLibraryName": "~node_modules/element-ui-theme/dist/theme"
    },
    ""
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants