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

主题定制问题 #27

Open
bk1d opened this issue Apr 4, 2019 · 5 comments
Open

主题定制问题 #27

bk1d opened this issue Apr 4, 2019 · 5 comments

Comments

@bk1d
Copy link
Contributor

bk1d commented Apr 4, 2019

我通过 variable.less 定制了主题,比如品牌颜色、字体大小等,debug 模式正常,但是 weex compile 后主题没有生效可能是 less 没有被编译进去?我该怎么解决呢?

@hminghe
Copy link
Owner

hminghe commented Apr 4, 2019

weex compile 应该使用的是命令自带的webpack配置。 所以没有生效!

@hminghe
Copy link
Owner

hminghe commented Apr 4, 2019

我了一下文档 , 可以用-c 修改webpack配置
https://weex.apache.org/zh/tools/toolkit.html#%E7%BC%96%E8%AF%91%E9%A1%B5%E9%9D%A2

@hminghe
Copy link
Owner

hminghe commented Apr 4, 2019

添加 configs/theme.config.js 文件,内容如下

var path = require('path')
module.exports = {
  resolve: {
    alias: {
        './variable.less':  '', // 你的variable.less文件!绝对路径
    }
  }
}
// 运行
weex compile .\src\index.vue build -c .\configs\theme.config.js

@bk1d
Copy link
Contributor Author

bk1d commented Apr 4, 2019

const path = require('path');
const helper = require('./helper');
export const resolve = {
    alias: {
        './variable.less': helper.resolve('src/theme/') + 'variable.less'
    }
};
# 下面两种方法都不生效
weex compile src dist -c configs/theme.config.js
weex compile src dist -c webpack.config.js

@hminghe
Copy link
Owner

hminghe commented Apr 6, 2019

const path = require('path');
const helper = require('./helper');
export const resolve = {
    alias: {
        './variable.less': helper.resolve('src/theme/') + 'variable.less'
    }
};
# 下面两种方法都不生效
weex compile src dist -c configs/theme.config.js
weex compile src dist -c webpack.config.js

就第一条。 我试了是正常的。 用最新版本的weex-toolkit

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

2 participants