Comments (14)
支持了编译的一些配置,应该可以满足你的需求了,可参考 demo10。
from miniprogram-simulate.
https://github.com/wechat-miniprogram/miniprogram-simulate/blob/master/docs/api.md#options
动态调整缓存大小我看看,不过这里可以调整目录的,本工具作为组件单测使用,建议按目录传入以免全量编译。
from miniprogram-simulate.
@JuneAndGreen 有看到的,但是因为组件引用路径是全局的,所以必须要设置rootPath为小程序的。
比如说组件.json:
{ "usingComponents": { "compa":"/pages/components/compa" } }
修改源代码也可以,但是改动会比较大
from miniprogram-simulate.
这个其实也可以在调 load 的时候改掉的,这样就不会因为 usingComponents 而导致必须使用大范围的 rootPath:
from miniprogram-simulate.
@JuneAndGreen 我试了,是可以的,感谢。但是如果有引用到wxs,就会报错找不到wxs,因为wxs并不是在组件下面。
能否让用户传入需要的wxml 和 wxs 文件路径列表?我看底层实现是找根目录下的全部wxml和wxs
比如说我通过分析wxml 和 json 文件,找到依赖的wxml和wxs文件路径,然后通过配置传进去?
from miniprogram-simulate.
emmm,这情况比较麻烦。
wxs 目前做不到,主要 wxs、wxss 和 wxml import 的路径处理都是由 wcsc 和 wcc 来处理的,这两个用的和工具用的编译器是同一个,我这边只是直接借用编译器无法侵入去改造。
from miniprogram-simulate.
@JuneAndGreen 我这边有个想法不知道行不行。
我看了miniprogram-compiler的wxmlToJs逻辑,里面遍历了全量wxml 和wxs,拿到wxmlList 和 wxsList
如果可以修改这个库的逻辑的话,那是不是就可以通过外部传入wxmlList 和 wxsList。
然后在外部去分析组件依赖的wxml,和wxs,得到wxmlList和wxsList。
不知道这样行不行。
from miniprogram-simulate.
https://github.com/wechat-miniprogram/miniprogram-simulate/pull/84/files
这是我做的处理,可以看一下
from miniprogram-simulate.
from miniprogram-simulate.
![]()
@JuneAndGreen 可以问下这里是忘记更新么?
噢,是的,这份之前是其他同学帮忙弄的,我这边遗漏了。
from miniprogram-simulate.
改了 [email protected],再试试看?
还有文档这里之前也笔误了,也一并改了:
from miniprogram-simulate.
可以了 感谢~
对了,之前在排查问题的时候,花了比较久的时间才排查到时因为缓存区的问题,感觉有时间可以优化一下。
我之前是通过打断点的方式找到错误的,比较麻烦。
from miniprogram-simulate.
可以的,我记一下。
from miniprogram-simulate.
可以了 感谢~ 对了,之前在排查问题的时候,花了比较久的时间才排查到时因为缓存区的问题,感觉有时间可以优化一下。 我之前是通过打断点的方式找到错误的,比较麻烦。
[email protected] 补充了,会将 spawnSync 的异常直接抛出来
from miniprogram-simulate.
Related Issues (20)
- About the license of components invoked by this Project. HOT 1
- 开启 virtualHost 之后,无法获取组件实例 HOT 2
- 开启 virtualHost 单测环境中渲染结果与官网描述不一致 HOT 2
- 使用comp.triggerLifeTime('ready')或者其他功能时,微信官方api(非wx.xxx)无法成功调用 HOT 3
- 是否支持 selectOwnerComponent HOT 4
- 能不能给一个搭配vitest的示例?
- How config miniprogram-simulate in Alipay mini program HOT 3
- Uniapp 编写的小程序可以使用么 HOT 1
- 在调用comp.detach()后. jest测试框架 的test函数无效. 报错:NotFoundError: The node to be removed is not a child of this node. HOT 4
- 无法测试报错的情形啊 HOT 1
- 我这样试了下貌似没有出现你说的问题,有没有具体的 demo?
- 能否加入在使用Component API 建立page时,可测试页面组件特性 HOT 2
- 是否考虑增加对于 TS 的支持,目前组件文件的 ts 语法会报错 HOT 1
- getStorageSync 套了一层JSON.parse,传入如果存入字符串,获取就会报错 HOT 3
- TypeError: wx.nextTick is not a function HOT 1
- Cannot find module 'pretty-format/build/plugins/lib/markup' from 'node_modules/miniprogram-simulate/src/jest-snapshot-plugin.js' HOT 2
- pretty-format依赖应声明为dependencies
- view 的 animation 属性,会导致组件无法渲染,该怎么处理
- ReferenceError: getCurrentPages is not defined HOT 1
- spawnSync ENOENT HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniprogram-simulate.