apache / incubator-weex-loader

Apache License 2.0
65 stars 32 forks source link

Can not use pug #62

Closed mdsb100 closed 6 years ago

mdsb100 commented 6 years ago
"weex-loader": "^0.6.14"
<template lang="pug">
</template>

error:

ERROR in ./node_modules/weex-loader/node_modules/weex-vue-loader/lib/template-compiler.js?id=data-v-2964abc9!./node_modules/weex-loader/node_modules/weex-vue-loader/lib/selector.js?type=template&index=0!./src/index.vue
    (Emitted value instead of an instance of Error) template syntax error Component template requires a root element, rather than just text.
     @ ./src/index.vue?entry=true 12:23-205
Hanks10100 commented 6 years ago

Example of using pug: http://dotwe.org/vue/99021166941b8839191cdcf6099ce231

Maybe you can config you webpack.config.js like this (for v2+):


rules: [{
    loader: 'weex-loader',
    options: {
        loaders: {
            scss: ['sass-loader'],
            sass: [{
                loader: 'sass-loader',
                options: { indentedSyntax: true }
            }],
            less: ['less-loader'],
            stylus: ['stylus-loader'],
            styl: ['stylus-loader']
        }
    }
}