vue-loader-for-apache-weex
vue-loader-for-apache-weex copied to clipboard
feat: enable the loaders chain
I wrote a loader for my project before weex-loader(failed) and vue loader(success), my webpack.config.js
like:
module: {
rules: [
{
test: /\.vue$/,
use: [
isWeeb ? 'vue-loader' : 'weex-loader',
'my-loader' // my loader here
]
}
]
}
Failed to work in weex-loader
, I found the reason from vue loader: vue-loader#loader.js, and weex-vue-loader
use filePath
but not rawRequest
.
// before
require("!!weex-loader/node_modules/weex-vue-loader/lib/style-loader!weex-loader/node_modules/weex-vue-loader/lib/style-rewriter?id=data-v-cf012960!weex-loader/node_modules/weex-vue-loader/lib/selector?type=styles&index=0!./index.vue"
// after
require("!!weex-loader/node_modules/weex-vue-loader/lib/style-loader!weex-loader/node_modules/weex-vue-loader/lib/style-rewriter?id=data-v-cf012960!weex-loader/node_modules/weex-vue-loader/lib/selector?type=styles&index=0!../../common/myLoader.js??ref--1-0!./index.vue"
It will apply the loaders chained before weex-vue-loader
+1