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

feat(scss): support global scss inject #2725

Merged
merged 1 commit into from
Apr 11, 2019
Merged

feat(scss): support global scss inject #2725

merged 1 commit into from
Apr 11, 2019

Conversation

psaren
Copy link
Contributor

@psaren psaren commented Apr 10, 2019

In order to be able to inject scss variables globally
import scss-bundle to get bundledContent

plugin: {
   sass: {
      resource:  'path/to/global.scss',
      // OR 
      // resource:  ['path/to/global.theme.scss', 'path/to/global.mixin.scss',]
      projectDirectory: '/path/to/project/directory'
  }
}

resource: The absolute path of the global scss file that needs to be injected(support array).
projectDirectory: Absolute project location, where node_modules are located.

Take effect when resource & projectDirectory is set.
Reference #425

@luckyadam
Copy link
Member

碉堡了!

@Rahim-Chan
Copy link
Contributor

projectDirectory 这是什么地址干嘛的,要填什么

@psaren
Copy link
Contributor Author

psaren commented Apr 22, 2019

projectDirectory: 项目根目录的绝对地址(若为小程序云开发模板,则应该是client目录)。
#文档#

@xuanmiaoshuo
Copy link

新建工程,1.3.0-beta中配置,不能使用🙅‍♂️

2 similar comments
@zhangzhenfei
Copy link

新建工程,1.3.0-beta中配置,不能使用🙅‍♂️

@zhangzhenfei
Copy link

新建工程,1.3.0-beta中配置,不能使用🙅‍♂️

@o-x-o
Copy link

o-x-o commented Jun 10, 2019

不能用

image

image

image

image

image

@DrakeXiang
Copy link

@o-x-o
是在plugins里面写sass字段:

...
plugins: {
  sass: {...},
  babel: {...}
},
...

@wufeicris
Copy link

请问下,我给每个文件都自动引入了全局变量,怎么设置让某一个单独的.scss文件不引入这些变量?

@cong1223
Copy link

sass: {
resource: 'path/to/global.scss',
// OR
// resource: ['path/to/global.theme.scss', 'path/to/global.mixin.scss',]
projectDirectory: '/path/to/project/directory'
}

plugins必须是数组类型

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

Successfully merging this pull request may close these issues.

9 participants