Closed daxingplay closed 7 years ago
Sorry that I cannot upgrade my existing project to .vue
files because there are still some users especially Android users using old versions of our App with an older version of Weex SDK which not supports vue-framework.
Thanks for fixing this. I think we should use lastIndexOf
instead of indexOf
here. You have such a patience and learned many details about weex-loader
. Great job. π
By the way, I also think path
is not appropriate since it's a built-in module of Node.js. filePath
maybe more reliable. You can change it passingly.
Thanks for your advice. I think filePath
is much better as well.
Hi, is this PR ready to merge? Thanks
Sorry for the delay, I have merged this PR.
Recently I found an issue with weex-loader compiling
.we
files. I wrote a simple webpack config from scratch:then I used
tnpm
to install modules withwebpack
1.14.0,weex-loader
0.4.4,babel-loader
6.4.0 and some other related packages. When I run build, there came an error:I tried to delete node_modules and re-run
tnpm install
many times, the error was still there. I looked into my node_modules and found that mybabel-loader
was in/Users/daxingplay/xxx/xxx/node_modules/.npminstall/babel-loader/6.4.0/babel-loader/
. After debugging weex-loader, I found this issue was related with the functionloadBabelModule
:I modified it to
Then the error was gone.
After reviewing #31 , PR #26 and this commit, I found that maybe I cannot simply use
require.resolve
to load babel modules, so I tried to changeindexOf
tolastIndexOf
, the error was gone as well.I guess my problem has some relations with
node
6.10 andnpm
3.10.10 ortnpm
4.19.4, it installs node_modules differently and put babel-loader under sub-folder with a version number. I'm not quite familiar with what changed in npm or tnpm, so I'm not sure my PR is right. You guys can judge that. π