@solar-taro/plugin-sun 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # plugin-sun
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build plugin-sun` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test plugin-sun` to execute the unit tests via [Vitest](https://vitest.dev/).
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 收集 ui-sun 中用到的原生组件
3
+ *
4
+ * taro 默认只生成 view/text/image 等常见的原生组件的静态模板,对于其他原生组件需要手动指定。
5
+ * taro 会在编译期间自动收集**应用程序级别**中显式出现过的原生组件来生成静态模板,
6
+ * 而这里是一个组件库,taro 并不会扫描到这里,所以我们需要自己收集
7
+ */
8
+ declare const _default: (context: any) => void;
9
+ export default _default;
package/index.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const NATIVE_COMPONENTS = [
4
+ 'canvas',
5
+ 'movable-area',
6
+ 'movable-view'
7
+ ];
8
+ /**
9
+ * 收集 ui-sun 中用到的原生组件
10
+ *
11
+ * taro 默认只生成 view/text/image 等常见的原生组件的静态模板,对于其他原生组件需要手动指定。
12
+ * taro 会在编译期间自动收集**应用程序级别**中显式出现过的原生组件来生成静态模板,
13
+ * 而这里是一个组件库,taro 并不会扫描到这里,所以我们需要自己收集
14
+ */
15
+ exports.default = (context) => {
16
+ context.modifyComponentConfig(({ componentConfig }) => {
17
+ for (const compName of NATIVE_COMPONENTS) {
18
+ componentConfig.includes.add(compName);
19
+ }
20
+ });
21
+ };
22
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/plugin-sun/src/index.ts"],"names":[],"mappings":";;AAOA,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,cAAc;IACd,cAAc;CACf,CAAA;AAED;;;;;;GAMG;AACH,kBAAe,CAAC,OAAY,EAAE,EAAE;IAC9B,OAAO,CAAC,qBAAqB,CAAC,CAAC,EAAE,eAAe,EAAwC,EAAE,EAAE;QAC1F,KAAK,MAAM,QAAQ,IAAI,iBAAiB,EAAE,CAAC;YACzC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACxC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAA"}
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@solar-taro/plugin-sun",
3
+ "version": "1.5.0",
4
+ "sideEffects": false,
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "types": "./index.d.ts",
12
+ "main": "./index.js",
13
+ "type": "commonjs"
14
+ }