@amaster.ai/vite-plugins 1.0.0-beta.3 → 1.0.0-beta.30

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/README.md CHANGED
@@ -1 +1,154 @@
1
1
  # @amaster.ai/vite-plugins
2
+
3
+ Vite plugins collection for Amaster.ai projects, including Taro development tools.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @amaster.ai/vite-plugins
9
+ ```
10
+
11
+ ## Plugins
12
+
13
+ ### 1. taroStyleAdapterPlugin
14
+
15
+ Automatically injects Taro page style adaptations in development mode to hide scrollbars while maintaining scroll functionality.
16
+
17
+ **Features:**
18
+ - Direct style injection into HTML (no postMessage needed)
19
+ - Only active in development mode (`serve`)
20
+ - Hides Taro page container scrollbar while maintaining scroll functionality
21
+ - **Automatically included in `devTools()`** - no separate import needed
22
+
23
+ **Usage:**
24
+
25
+ Already included when you use `devTools()`:
26
+
27
+ ```typescript
28
+ import devTools from '@amaster.ai/vite-plugins'
29
+
30
+ export default {
31
+ compiler: {
32
+ type: 'vite',
33
+ vitePlugins: [
34
+ ...devTools() // ✅ taroStyleAdapterPlugin is already included
35
+ ]
36
+ }
37
+ }
38
+ ```
39
+
40
+ Or use it standalone if needed:
41
+
42
+ ```typescript
43
+ import { taroStyleAdapterPlugin } from '@amaster.ai/vite-plugins'
44
+
45
+ export default {
46
+ compiler: {
47
+ type: 'vite',
48
+ vitePlugins: [
49
+ taroStyleAdapterPlugin()
50
+ ]
51
+ }
52
+ }
53
+ ```
54
+
55
+ **How it works:**
56
+
57
+ The plugin uses Vite's `transformIndexHtml` hook to inject styles directly into the HTML `<head>`:
58
+
59
+ ```html
60
+ <style data-taro-adapter="true">
61
+ /* 隐藏 Taro 页面容器滚动条 */
62
+ .taro_page {
63
+ -ms-overflow-style: none;
64
+ scrollbar-width: none;
65
+ }
66
+ .taro_page::-webkit-scrollbar {
67
+ width: 0;
68
+ height: 0;
69
+ display: none;
70
+ }
71
+
72
+ /* 隐藏 Taro ScrollView 组件滚动条 */
73
+ .taro-scroll-view__scroll-y,
74
+ .taro-scroll-view__scroll-x {
75
+ -ms-overflow-style: none;
76
+ scrollbar-width: none;
77
+ }
78
+ .taro-scroll-view__scroll-y::-webkit-scrollbar,
79
+ .taro-scroll-view__scroll-x::-webkit-scrollbar {
80
+ width: 0;
81
+ height: 0;
82
+ display: none;
83
+ }
84
+ </style>
85
+ ```
86
+
87
+ This approach is simpler and more reliable than message-based communication.
88
+
89
+ ### 2. injectTaroEnv / injectAmasterEnv
90
+
91
+ Environment variable injection helpers for Taro's `defineConstants`.
92
+
93
+ **Usage:**
94
+
95
+ ```typescript
96
+ import { injectAmasterEnv, injectTaroEnv } from '@amaster.ai/vite-plugins'
97
+
98
+ export default defineConfig({
99
+ defineConstants: {
100
+ ...injectAmasterEnv(),
101
+ // or
102
+ ...injectTaroEnv({
103
+ additional: ['CUSTOM_VAR'],
104
+ autoInjectTaroApp: true,
105
+ autoInjectVite: true
106
+ })
107
+ }
108
+ })
109
+ ```
110
+
111
+ ### 3. componentIdPlugin
112
+
113
+ Adds unique IDs to components for development tools tracking.
114
+
115
+ ### 4. editorBridgePlugin
116
+
117
+ Enables communication bridge between Taro app and editor.
118
+
119
+ ### 5. routesExposePlugin
120
+
121
+ Exposes route information for editor integration.
122
+
123
+ ### 6. browserLogsPlugin
124
+
125
+ Captures and forwards browser console logs (auto-enabled in sandbox environment).
126
+
127
+ ## Development Tools Collection
128
+
129
+ Use `devTools()` to quickly enable all development plugins:
130
+
131
+ ```typescript
132
+ import devTools from '@amaster.ai/vite-plugins'
133
+
134
+ export default defineConfig({
135
+ compiler: {
136
+ type: 'vite',
137
+ vitePlugins: [
138
+ ...devTools(),
139
+ // ... other plugins
140
+ ]
141
+ }
142
+ })
143
+ ```
144
+
145
+ This includes:
146
+ - **taroStyleAdapterPlugin** - Taro H5 scrollbar hiding
147
+ - **componentIdPlugin** - Component ID tracking
148
+ - **editorBridgePlugin** - Editor communication
149
+ - **routesExposePlugin** - Route information exposure
150
+ - **browserLogsPlugin** - Browser console forwarding (when in sandbox)
151
+
152
+ ## License
153
+
154
+ MIT
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var crypto=require('crypto'),f=require('fs'),b=require('path'),url=require('url'),E=require('process');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);var b__default=/*#__PURE__*/_interopDefault(b);var E__default=/*#__PURE__*/_interopDefault(E);function _(r,e){let n=`${r}:${e}`;return crypto.createHash("md5").update(n).digest("hex").substring(0,12)}var T=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function y(){let r=false;return {name:"vite-plugin-component-id",enforce:"pre",configResolved(e){r=e.command==="serve";},transform(e,n){if(!r||!/\.(tsx|jsx)$/.test(n)||n.includes("node_modules")||!/<[a-z]/.test(e))return null;try{let t=e,o=/<([a-z][\da-z]*)(?=[\s/>])/g,a,i=[];for(;(a=o.exec(e))!==null;){let s=a[1];if(!s)continue;let d=a.index,c=a.index+a[0].length;if(!T.has(s))continue;let u=c,p=!1,g=!1;for(;u<e.length&&!p;)e[u]===">"&&(p=!0,e.substring(d,u).includes("data-node-component-id")&&(g=!0)),u++;g||i.push({index:d,tag:s,tagEndIndex:c});}let l=e;for(let s=i.length-1;s>=0;s--){let d=i[s];if(!d)continue;let{index:c,tagEndIndex:u}=d,p=_(n,c),g=l.substring(0,u),m=l.substring(u);t=`${g} data-node-component-id="${p}"${m}`,l=t;}return {code:t,map:null}}catch{return null}}}}var I=`<script>
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var crypto=require('crypto'),g=require('fs'),S=require('path'),url=require('url'),H=require('process');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var g__default=/*#__PURE__*/_interopDefault(g);var S__default=/*#__PURE__*/_interopDefault(S);var H__default=/*#__PURE__*/_interopDefault(H);function T(t,e){let n=`${t}:${e}`;return crypto.createHash("md5").update(n).digest("hex").substring(0,12)}var O=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function h(){let t=false;return {name:"vite-plugin-component-id",enforce:"pre",configResolved(e){t=e.command==="serve";},transform(e,n){if(!t||!/\.(tsx|jsx)$/.test(n)||n.includes("node_modules")||!/<[a-z]/.test(e))return null;try{let r=e,s=/<([a-z][\da-z]*)(?=[\s/>])/g,a,o=[];for(;(a=s.exec(e))!==null;){let i=a[1];if(!i)continue;let c=a.index,d=a.index+a[0].length;if(!O.has(i))continue;let l=d,p=!1,f=!1;for(;l<e.length&&!p;)e[l]===">"&&(p=!0,e.substring(c,l).includes("data-node-component-id")&&(f=!0)),l++;f||o.push({index:c,tag:i,tagEndIndex:d});}let u=e;for(let i=o.length-1;i>=0;i--){let c=o[i];if(!c)continue;let{index:d,tagEndIndex:l}=c,p=T(n,d),f=u.substring(0,l),y=u.substring(l);r=`${f} data-node-component-id="${p}"${y}`,u=r;}return {code:r,map:null}}catch{return null}}}}var P=`<script>
2
2
  document.addEventListener("click", (e) => {
3
3
  const element = e.target;
4
4
  const noJumpOut = document.body.classList.contains("forbid-jump-out")
@@ -16,15 +16,15 @@ document.addEventListener("click", (e) => {
16
16
  e.preventDefault();
17
17
  }
18
18
  });
19
- </script>`;function H(){try{let r=url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),e=b.dirname(r),n=b.resolve(e,"../dist/bridge.bridge.js");return `<script>
20
- ${f.readFileSync(n,"utf-8")}
21
- </script>`}catch(r){return console.warn("Failed to read bridge script:",r),""}}function h(){let r=false,e="";return {name:"vite-plugin-editor-bridge",configResolved(n){r=n.command==="serve",r&&(e=H());},transformIndexHtml(n){let o=`${I}${r?e:""}</body>`;return n.replace("</body>",o)}}}function v(r){let e=false,n=r?.routesFilePath||"src/routes.tsx";return {name:"vite-plugin-routes-expose",enforce:"post",configResolved(t){e=t.command==="serve";},transform(t,o){if(!e||!o.endsWith(n))return null;try{return t.includes("window.__APP_ROUTES__")?null:{code:`${t}
19
+ </script>`;function q(){try{let t=url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),e=S.dirname(t),n=S.resolve(e,"../dist/bridge.bridge.js");return `<script>
20
+ ${g.readFileSync(n,"utf-8")}
21
+ </script>`}catch(t){return console.warn("Failed to read bridge script:",t),""}}function v(){let t=false,e="";return {name:"vite-plugin-editor-bridge",configResolved(n){t=n.command==="serve",t&&(e=q());},transformIndexHtml(n){let s=`${P}${t?e:""}</body>`;return n.replace("</body>",s)}}}function b(t){let e=false,n=t?.routesFilePath||"src/routes.tsx";return {name:"vite-plugin-routes-expose",enforce:"post",configResolved(r){e=r.command==="serve";},transform(r,s){if(!e||!s.endsWith(n))return null;try{return r.includes("window.__APP_ROUTES__")?null:{code:`${r}
22
22
 
23
23
  // Development mode: Expose routes to window.__APP_ROUTES__
24
24
  if (typeof window !== 'undefined') {
25
25
  window.__APP_ROUTES__ = typeof routes !== 'undefined' && Array.isArray(routes) ? routes : [];
26
26
  }
27
- `,map:null}}catch{return null}}}}function w(){let r="",e=`
27
+ `,map:null}}catch{return null}}}}function _(){let t="",e=`
28
28
  <script>
29
29
  (function() {
30
30
  'use strict';
@@ -490,6 +490,170 @@ if (typeof window !== 'undefined') {
490
490
  addLog(entry);
491
491
  });
492
492
 
493
+ // ============================================
494
+ // Vite deps 504 error capture using PerformanceObserver
495
+ // Only captures 504 errors for node_modules/.vite resources (pre-bundled dependencies)
496
+ // ============================================
497
+ var reportedUrls = {}; // Track reported URLs to avoid duplicates
498
+
499
+ if (typeof PerformanceObserver !== 'undefined') {
500
+ var perfObserver = new PerformanceObserver(function(list) {
501
+ var entries = list.getEntries();
502
+ for (var i = 0; i < entries.length; i++) {
503
+ var perfEntry = entries[i];
504
+ // Only check script resources
505
+ if (perfEntry.initiatorType !== 'script') {
506
+ continue;
507
+ }
508
+
509
+ var resourceUrl = perfEntry.name || '';
510
+ // Only report errors for node_modules/.vite resources
511
+ if (resourceUrl.indexOf('node_modules/.vite') === -1 && resourceUrl.indexOf('/node_modules/.vite') === -1) {
512
+ continue;
513
+ }
514
+
515
+ // Check if response status is 504 (Gateway Timeout)
516
+ // responseStatus is available in Resource Timing Level 2
517
+ var status = perfEntry.responseStatus;
518
+ if (status === 504) {
519
+ // Avoid duplicate reports
520
+ if (reportedUrls[resourceUrl]) {
521
+ continue;
522
+ }
523
+ reportedUrls[resourceUrl] = true;
524
+
525
+ var entry = {
526
+ type: 'vite-deps-error',
527
+ timestamp: new Date().toISOString(),
528
+ level: 'error',
529
+ url: resourceUrl,
530
+ status: 504,
531
+ message: 'Vite pre-bundled dependency returned 504 Gateway Timeout: ' + resourceUrl,
532
+ duration: perfEntry.duration,
533
+ transferSize: perfEntry.transferSize
534
+ };
535
+ addLog(entry);
536
+ }
537
+ }
538
+ });
539
+
540
+ try {
541
+ perfObserver.observe({ type: 'resource', buffered: true });
542
+ } catch (e) {
543
+ // Fallback for browsers that don't support the options
544
+ try {
545
+ perfObserver.observe({ entryTypes: ['resource'] });
546
+ } catch (e2) {
547
+ originalConsole.warn('[BrowserLogs] PerformanceObserver not supported:', e2.message);
548
+ }
549
+ }
550
+ }
551
+
552
+ // ============================================
553
+ // Script load error capture (for 504 and other network errors)
554
+ // This captures errors that PerformanceObserver might miss
555
+ // ============================================
556
+
557
+ // Use MutationObserver to watch for dynamically added script tags
558
+ function attachScriptErrorHandler(script) {
559
+ if (script.__errorHandlerAttached__) return;
560
+ script.__errorHandlerAttached__ = true;
561
+
562
+ script.addEventListener('error', function(event) {
563
+ var src = script.src || '';
564
+
565
+ // Only report errors for node_modules/.vite resources
566
+ if (src.indexOf('node_modules/.vite') === -1 && src.indexOf('/node_modules/.vite') === -1) {
567
+ return;
568
+ }
569
+
570
+ // Avoid duplicate reports
571
+ if (reportedUrls[src]) {
572
+ return;
573
+ }
574
+ reportedUrls[src] = true;
575
+
576
+ var entry = {
577
+ type: 'vite-deps-error',
578
+ timestamp: new Date().toISOString(),
579
+ level: 'error',
580
+ url: src,
581
+ status: 'load-error',
582
+ message: 'Vite pre-bundled dependency failed to load (possibly 504 Gateway Timeout): ' + src,
583
+ errorType: event.type
584
+ };
585
+ addLog(entry);
586
+ });
587
+ }
588
+
589
+ // Attach error handlers to existing scripts
590
+ var existingScripts = document.querySelectorAll('script[src]');
591
+ for (var i = 0; i < existingScripts.length; i++) {
592
+ attachScriptErrorHandler(existingScripts[i]);
593
+ }
594
+
595
+ // Watch for dynamically added scripts
596
+ if (typeof MutationObserver !== 'undefined') {
597
+ var scriptObserver = new MutationObserver(function(mutations) {
598
+ for (var i = 0; i < mutations.length; i++) {
599
+ var mutation = mutations[i];
600
+ for (var j = 0; j < mutation.addedNodes.length; j++) {
601
+ var node = mutation.addedNodes[j];
602
+ if (node.nodeName === 'SCRIPT' && node.src) {
603
+ attachScriptErrorHandler(node);
604
+ }
605
+ // Also check child nodes
606
+ if (node.querySelectorAll) {
607
+ var scripts = node.querySelectorAll('script[src]');
608
+ for (var k = 0; k < scripts.length; k++) {
609
+ attachScriptErrorHandler(scripts[k]);
610
+ }
611
+ }
612
+ }
613
+ }
614
+ });
615
+
616
+ scriptObserver.observe(document.documentElement, {
617
+ childList: true,
618
+ subtree: true
619
+ });
620
+ }
621
+
622
+ // Also intercept document.createElement to catch scripts before they're added to DOM
623
+ var originalCreateElement = document.createElement.bind(document);
624
+ document.createElement = function(tagName) {
625
+ var element = originalCreateElement(tagName);
626
+ if (tagName.toLowerCase() === 'script') {
627
+ // Use a setter to catch when src is set
628
+ var originalSrc = '';
629
+ Object.defineProperty(element, '__originalSrc__', {
630
+ get: function() { return originalSrc; },
631
+ set: function(val) { originalSrc = val; }
632
+ });
633
+
634
+ // Defer attaching error handler until src is set
635
+ var srcDescriptor = Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype, 'src');
636
+ if (srcDescriptor && srcDescriptor.set) {
637
+ var originalSrcSetter = srcDescriptor.set;
638
+ Object.defineProperty(element, 'src', {
639
+ get: function() {
640
+ return srcDescriptor.get ? srcDescriptor.get.call(this) : this.getAttribute('src');
641
+ },
642
+ set: function(value) {
643
+ if (originalSrcSetter) {
644
+ originalSrcSetter.call(this, value);
645
+ } else {
646
+ this.setAttribute('src', value);
647
+ }
648
+ attachScriptErrorHandler(this);
649
+ },
650
+ configurable: true
651
+ });
652
+ }
653
+ }
654
+ return element;
655
+ };
656
+
493
657
  window.addEventListener('unhandledrejection', function(event) {
494
658
  var entry = {
495
659
  type: 'error',
@@ -541,6 +705,34 @@ if (typeof window !== 'undefined') {
541
705
 
542
706
  originalConsole.log('[BrowserLogs] Log collection started');
543
707
  })();
544
- </script>`;return {name:"vite-plugin-browser-logs",configResolved(n){let t=n.root||E__default.default.cwd();r=b__default.default.join(t,"browser.log");},configureServer(n){n.middlewares.use((t,o,a)=>{if(t.url==="/__browser__"&&t.method==="POST"){let i=t.headers.origin||"*",l="";t.on("data",s=>{l+=s.toString();}),t.on("end",()=>{try{let s=b__default.default.dirname(r);f__default.default.existsSync(s)||f__default.default.mkdirSync(s,{recursive:!0}),f__default.default.appendFileSync(r,`${l}
545
- `,"utf-8"),o.writeHead(200,{"Content-Type":"application/json","Access-Control-Allow-Origin":i,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}),o.end(JSON.stringify({success:!0}));}catch(s){console.error("[BrowserLogs] Write error:",s),o.writeHead(500,{"Content-Type":"application/json","Access-Control-Allow-Origin":i,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}),o.end(JSON.stringify({success:false,error:String(s)}));}});}else if(t.url==="/__browser__"&&t.method==="OPTIONS"){let i=t.headers.origin||"*";o.writeHead(204,{"Access-Control-Allow-Origin":i,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type","Access-Control-Max-Age":"86400"}),o.end();}else if(t.url==="/__browser__"){let i=t.headers.origin||"*";o.writeHead(405,{"Content-Type":"application/json","Access-Control-Allow-Origin":i}),o.end(JSON.stringify({error:"Method not allowed"}));}else a();}),console.log("[BrowserLogs] Logs will be written to:",r);},transformIndexHtml(n){return n.replace(/<head([^>]*)>/i,`<head$1>${e}`)}}}function L(r={}){let e=[y(),h(),v()];return E__default.default.env.WORKSPACE_GIT_REPO&&e.push(w()),e}exports.componentIdPlugin=y;exports.default=L;exports.editorBridgePlugin=h;exports.routesExposePlugin=v;//# sourceMappingURL=index.cjs.map
708
+ </script>`;return {name:"vite-plugin-browser-logs",configResolved(n){let r=n.root||H__default.default.cwd();t=S__default.default.join(r,"browser.log");},configureServer(n){n.middlewares.use((r,s,a)=>{if(r.url==="/__browser__"&&r.method==="POST"){let o=r.headers.origin||"*",u="";r.on("data",i=>{u+=i.toString();}),r.on("end",()=>{try{let i=S__default.default.dirname(t);g__default.default.existsSync(i)||g__default.default.mkdirSync(i,{recursive:!0}),g__default.default.appendFileSync(t,`${u}
709
+ `,"utf-8"),s.writeHead(200,{"Content-Type":"application/json","Access-Control-Allow-Origin":o,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}),s.end(JSON.stringify({success:!0}));}catch(i){console.error("[BrowserLogs] Write error:",i),s.writeHead(500,{"Content-Type":"application/json","Access-Control-Allow-Origin":o,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type"}),s.end(JSON.stringify({success:false,error:String(i)}));}});}else if(r.url==="/__browser__"&&r.method==="OPTIONS"){let o=r.headers.origin||"*";s.writeHead(204,{"Access-Control-Allow-Origin":o,"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type","Access-Control-Max-Age":"86400"}),s.end();}else if(r.url==="/__browser__"){let o=r.headers.origin||"*";s.writeHead(405,{"Content-Type":"application/json","Access-Control-Allow-Origin":o}),s.end(JSON.stringify({error:"Method not allowed"}));}else a();}),console.log("[BrowserLogs] Logs will be written to:",t);},transformIndexHtml(n){return n.replace(/<head([^>]*)>/i,`<head$1>${e}`)}}}function m(){return {name:"vite-plugin-taro-style-adapter",apply:"serve",transformIndexHtml(t){return t.replace("</head>",`
710
+ <style data-taro-adapter="true">
711
+ /* \u4EC5 H5 \u751F\u6548\uFF1A\u9690\u85CF Taro \u9875\u9762\u5BB9\u5668\u6EDA\u52A8\u6761\uFF0C\u4F46\u4ECD\u53EF\u6EDA\u52A8 */
712
+ .taro_page {
713
+ -ms-overflow-style: none; /* IE/Edge \u8001\u7248 */
714
+ scrollbar-width: none; /* Firefox */
715
+ }
716
+
717
+ .taro_page::-webkit-scrollbar {
718
+ width: 0;
719
+ height: 0;
720
+ display: none; /* Chrome/Safari */
721
+ }
722
+
723
+ /* \u9690\u85CF Taro ScrollView \u7EC4\u4EF6\u7684\u6EDA\u52A8\u6761 */
724
+ .taro-scroll-view__scroll-y,
725
+ .taro-scroll-view__scroll-x {
726
+ -ms-overflow-style: none; /* IE/Edge \u8001\u7248 */
727
+ scrollbar-width: none; /* Firefox */
728
+ }
729
+
730
+ .taro-scroll-view__scroll-y::-webkit-scrollbar,
731
+ .taro-scroll-view__scroll-x::-webkit-scrollbar {
732
+ width: 0;
733
+ height: 0;
734
+ display: none; /* Chrome/Safari */
735
+ }
736
+ </style>
737
+ </head>`)}}}function k(t={}){let{additional:e=[],autoInjectTaroApp:n=true,autoInjectVite:r=true}=t,s={},a=new Set(e);return n&&Object.keys(process.env).forEach(o=>{o.startsWith("TARO_APP_")&&a.add(o);}),r&&Object.keys(process.env).forEach(o=>{o.startsWith("VITE_")&&a.add(o);}),a.forEach(o=>{let u=process.env[o]||"";s[`process.env.${o}`]=JSON.stringify(u);}),s}function L(){return {"process.env.TARO_APP_API_BASE_URL":JSON.stringify(process.env.TARO_APP_API_BASE_URL||""),"process.env.VITE_API_BASE_URL":JSON.stringify(process.env.VITE_API_BASE_URL||"")}}function B(t={}){let e=[m(),h(),v(),b()];return H__default.default.env.WORKSPACE_GIT_REPO&&e.push(_()),e}exports.componentIdPlugin=h;exports.default=B;exports.editorBridgePlugin=v;exports.injectAmasterEnv=L;exports.injectTaroEnv=k;exports.routesExposePlugin=b;exports.taroStyleAdapterPlugin=m;//# sourceMappingURL=index.cjs.map
546
738
  //# sourceMappingURL=index.cjs.map