hminghe/weex-amui

主题定制问题

Opened this issue · 5 comments

bk1d commented

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

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

添加 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 commented
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
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