Closed lwfyiwei closed 7 years ago
一样 weex-loader 这个包不对
@Hanks10100 @Jinjiang
├── babel-core@6.21.0
├── babel-loader@6.2.10
├── babel-plugin-transform-runtime@6.15.0
├── babel-preset-es2015@6.18.0
├── babel-runtime@6.20.0
├── css-loader@0.26.1
├── serve@1.4.0
├── vue@2.1.6
├── vue-loader@10.0.2
├── vue-router@2.1.1
├── vue-template-compiler@2.1.6
├── vuex@2.1.1
├── vuex-router-sync@4.0.2
├── webpack@1.14.0
├── weex-loader@0.4.0
└── weex-vue-render@0.1.0-beta.2
npm run build:weex
@yjj5855 @lwfyiwei 你们这个问题解决了吗?
我在 node 4.0.0 上执行 npm run build:week 是没问题,估计是在高版本的node上npm扁平之后的原因
@alwayrun node 6 npm 3
同样有这个问题...
solution anyone ?
我看一下
和这个issue是一样的。 https://github.com/weexteam/weex-loader/issues/39 我目前是 node v7.2.9 npm v3.10.9
@Jinjiang 我对webpack.weex.config.js
做了些修改,在载入`weex-loader之前,载入
vue-loader`对Vue文件进行编译,然后整个编译就顺利通过了。
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}, {
test: /\.vue(\?[^?]+)?$/,
loaders: ['weex-loader']
}, {
test: /\.vue(\?[^?]+)?$/,
loaders: ['vue-loader']
}
]
}
But I think we still need to update webpack config files. The output index.weex.js uses Vue
instance, when copied to ios/assets
and build on device will throw exception ReferenceError: Can't find variable: Vue
.
I'm using weex-loader@0.4.1
Sorry about the confusions. This app is under development, the code in master branch may not always new. It's my fault.
The webpack config works well in my env. I will check the compatibility of weex-loader
. Although weex-loader
support to compile .vue
files, but the weex-vue-loader
should also be installed.
Thank you for all the hard work @Hanks10100. I'll update my env and add weex-vue-loader to the loader modules. See if this helps.
It seems work well in latest master commit
@Jinjiang Well, pulled the lastest code just now, it seems still has this problem. My dev environment:
Window 10
Node v7.3.0
NPM 4.0.5
Exact same problem as @WalterZou here. Environment:
macOS 10.12 Node v7.3.0
npm 4.0.5
I guess vue-weex-loader still needs to be added in the webpack config
loaders: ['weex-loader', 'weex-vue-loader']
With this, it builds perfectly on my setup
@PymZoR It should works well with only weex-loader
, and I can't trigger that error on my env (node v6.6.0).
I have tried to add weex-vue-loader
in webpack config, but the bundle it generated is not correct.
Maybe some dependencies is missing in weex-loader, I will figure out the reason of this bizarre behavior.
I have make a update for weex-vue-loader
. And now we don't need to write it into devDeps
directly because weex-loader
depends on it.
It works well for me at this time.
Thanks.