Giter Site home page Giter Site logo

wxa-cli's Introduction

  • I'm wzt.

  • I’m currently working on Webank 🔭

  • I’m currently learning WASM/FFmpeg/vue3 🤔

  • Father of cookie 🐕 and nemo 🐈 and tuizhi 🐈

wxa-cli's People

Contributors

genuifx avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

wxa-cli's Issues

windows下npm路径问题

报错:
thirdScriptError
sdk uncaught third Error
can't find module : ../npm/@wxa/core/dist/wxa.js
Error: can't find module : ../npm/@wxa/core/dist/wxa.js

正确的路径是./npm/@wxa/core/dist/wxa.js

原因应该是:
compile-script.js
resolveDeps方法:
resolved = path.relative(getDistPath(opath, 'js', this.src, this.dist), target).replace(/^\.\.\//, './');
replace没有匹配到,windows下relative出来的路径分隔符是\而不是/
relative的路径: ..\npm\@wxa\core\dist\wxa.js

改成这样windows路径就正确了
resolved = path.relative(getDistPath(opath, 'js', this.src, this.dist), target).replace(/^\.\.\\/, './');


另外建议:

// 转化windowd的\\,修复path,relative需要向上一级目录的缺陷
 resolved = resolved.replace(/\\/g, '/');

改成这样:
resolved = resolved.split(path.sep).join('/')
参考链接:http://www.yzmspirit.com/2017/06/14/windows%E5%92%8Clinux%E4%B8%8B%E7%9A%84%E8%B7%AF%E5%BE%84%E5%88%86%E9%9A%94%E7%AC%A6%E9%97%AE%E9%A2%98/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.