Open qbcbyb opened 6 years ago
var weexConfig = getBaseConfig(); weexConfig.output.filename = '[name].weex.js'; weexConfig.module.rules[2].loader = 'weex-loader'; weexConfig.module.rules[2].options = { lang: { less: ['less-loader'] } };
Cannot read property 'map' of undefined
console.log
var weexConfig = getBaseConfig(); weexConfig.output.filename = '[name].weex.js'; weexConfig.module.rules[2].loader = 'weex-loader'; weexConfig.module.rules[2].options = { loaders: { less: ['less-loader'] } };
.vue
<style lang='less' scoped>
const less = require('postcss-less'); var weexConfig = getBaseConfig(); weexConfig.output.filename = '[name].weex.js'; weexConfig.module.rules[2].loader = 'weex-loader'; weexConfig.module.rules[2].options = { loaders: { less: ['less-loader'] }, postcss: { options: { syntax: less } } };
对于webpack的config,还请官方不要频繁改动api导致配置变化,若实在需要改动,也请给出明确的文档作参考。
Cannot read property 'map' of undefined
,没文档、没参考,只能自己一点一点用console.log
去判断,最后发现weex-loader的options中的lang已经弃用改用loaders了。就将代码修改为:.vue
文件中配置的<style lang='less' scoped>
,不能用mixins,最后又是一通console.log
,靠猜和试才得出以下暂时可用的配置:对于webpack的config,还请官方不要频繁改动api导致配置变化,若实在需要改动,也请给出明确的文档作参考。