tamagui-loader 2.7.6 → 2.7.7-1788328229285

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/dist/cjs/css.cjs CHANGED
@@ -22,9 +22,13 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
22
  }), mod);
23
23
  var css_exports = {};
24
24
  __export(css_exports, {
25
+ cssLoaderPath: () => cssLoaderPath,
25
26
  default: () => loader
26
27
  });
27
28
  module.exports = __toCommonJS(css_exports);
29
+ var import_node_url = require("node:url");
30
+ const import_meta = {};
31
+ const cssLoaderPath = "url" in import_meta ? (0, import_node_url.fileURLToPath)(import_meta.url) : __filename;
28
32
  function loader() {
29
33
  this.async();
30
34
  const options = {
@@ -37,21 +37,11 @@ __export(loader_exports, {
37
37
  });
38
38
  module.exports = __toCommonJS(loader_exports);
39
39
  var StaticWorker = __toESM(require("@tamagui/static-worker"), 1);
40
- var import_requireResolve = require("./requireResolve.cjs");
40
+ var import_css = require("./css.cjs");
41
41
  const {
42
42
  getPragmaOptions
43
43
  } = StaticWorker;
44
44
  Error.stackTraceLimit = Number.POSITIVE_INFINITY;
45
- let CSS_LOADER_PATH = "";
46
- try {
47
- CSS_LOADER_PATH = (0, import_requireResolve.requireResolve)("./css.cjs");
48
- } catch {
49
- try {
50
- CSS_LOADER_PATH = (0, import_requireResolve.requireResolve)("./css.esm");
51
- } catch {
52
- CSS_LOADER_PATH = (0, import_requireResolve.requireResolve)("./css.js");
53
- }
54
- }
55
45
  let index = 0;
56
46
  process.env.TAMAGUI_TARGET = "web";
57
47
  const loader = async function loader2(sourceIn) {
@@ -99,7 +89,7 @@ const loader = async function loader2(sourceIn) {
99
89
  if (extracted.styles) {
100
90
  const cssQuery = `cssData=${Buffer.from(extracted.styles).toString("base64")}`;
101
91
  const remReq = this.remainingRequest;
102
- const importPath = `${cssPath}!=!${CSS_LOADER_PATH}?${cssQuery}!${remReq}`;
92
+ const importPath = `${cssPath}!=!${import_css.cssLoaderPath}?${cssQuery}!${remReq}`;
103
93
  extracted.js = `${extracted.js}
104
94
 
105
95
  require(${JSON.stringify(importPath)})`;
package/dist/esm/css.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { fileURLToPath } from "node:url";
2
+ const cssLoaderPath = "url" in import.meta ? fileURLToPath(import.meta.url) : __filename;
1
3
  function loader() {
2
4
  this.async();
3
5
  const options = {
@@ -12,5 +14,5 @@ function loader() {
12
14
  name: "missing_css"
13
15
  });
14
16
  }
15
- export { loader as default };
17
+ export { cssLoaderPath, loader as default };
16
18
  //# sourceMappingURL=css.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["loader","async","options","getOptions","out","Buffer","from","cssData","toString","callback","message","name"],"sources":["../../src/css.ts"],"sourcesContent":[null],"mappings":"AAGe,SAARA,OAAA,EAA6D;EAClE,KAAKC,KAAA,CAAM;EACX,MAAMC,OAAA,GAAU;IAAE,GAAG,KAAKC,UAAA,CAAW;EAAE;EACvC,IAAIC,GAAA,GAAMC,MAAA,CAAOC,IAAA,CAAKJ,OAAA,CAAQK,OAAA,EAAS,QAAQ,EAAEC,QAAA,CAAS,OAAO;EACjE,IAAIJ,GAAA,EAAK;IAEP,OAAO,KAAKK,QAAA,CAAS,MAAML,GAAA,IAAO,EAAE;EACtC;EACA,KAAKK,QAAA,CAAS;IAAEC,OAAA,EAAS;IAAgBC,IAAA,EAAM;EAAc,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"names":["fileURLToPath","cssLoaderPath","import","meta","url","__filename","loader","async","options","getOptions","out","Buffer","from","cssData","toString","callback","message","name"],"sources":["../../src/css.ts"],"sourcesContent":[null],"mappings":"AAEA,SAASA,aAAA,QAAqB;AAEvB,MAAMC,aAAA,GACX,SAASC,MAAA,CAAAC,IAAA,GAAcH,aAAA,CAAcE,MAAA,CAAAC,IAAA,CAAYC,GAAG,IAAIC,UAAA;AAE3C,SAARC,OAAA,EAA6D;EAClE,KAAKC,KAAA,CAAM;EACX,MAAMC,OAAA,GAAU;IAAE,GAAG,KAAKC,UAAA,CAAW;EAAE;EACvC,IAAIC,GAAA,GAAMC,MAAA,CAAOC,IAAA,CAAKJ,OAAA,CAAQK,OAAA,EAAS,QAAQ,EAAEC,QAAA,CAAS,OAAO;EACjE,IAAIJ,GAAA,EAAK;IAEP,OAAO,KAAKK,QAAA,CAAS,MAAML,GAAA,IAAO,EAAE;EACtC;EACA,KAAKK,QAAA,CAAS;IAAEC,OAAA,EAAS;IAAgBC,IAAA,EAAM;EAAc,CAAC;AAChE","ignoreList":[]}
@@ -1,19 +1,9 @@
1
1
  import * as StaticWorker from "@tamagui/static-worker";
2
- import { requireResolve } from "./requireResolve.mjs";
2
+ import { cssLoaderPath } from "./css.mjs";
3
3
  const {
4
4
  getPragmaOptions
5
5
  } = StaticWorker;
6
6
  Error.stackTraceLimit = Number.POSITIVE_INFINITY;
7
- let CSS_LOADER_PATH = "";
8
- try {
9
- CSS_LOADER_PATH = requireResolve("./css.cjs");
10
- } catch {
11
- try {
12
- CSS_LOADER_PATH = requireResolve("./css.esm");
13
- } catch {
14
- CSS_LOADER_PATH = requireResolve("./css.js");
15
- }
16
- }
17
7
  let index = 0;
18
8
  process.env.TAMAGUI_TARGET = "web";
19
9
  const loader = async function loader2(sourceIn) {
@@ -59,9 +49,7 @@ const loader = async function loader2(sourceIn) {
59
49
  });
60
50
  if (!extracted) return callback(null, source);
61
51
  if (extracted.styles) {
62
- const cssQuery = `cssData=${Buffer.from(extracted.styles).toString("base64")}`;
63
- const remReq = this.remainingRequest;
64
- const importPath = `${cssPath}!=!${CSS_LOADER_PATH}?${cssQuery}!${remReq}`;
52
+ const importPath = `${cssPath}!=!${cssLoaderPath}?${`cssData=${Buffer.from(extracted.styles).toString("base64")}`}!${this.remainingRequest}`;
65
53
  extracted.js = `${extracted.js}
66
54
 
67
55
  require(${JSON.stringify(importPath)})`;
@@ -1 +1 @@
1
- {"version":3,"names":["StaticWorker","requireResolve","getPragmaOptions","Error","stackTraceLimit","Number","POSITIVE_INFINITY","CSS_LOADER_PATH","index","process","env","TAMAGUI_TARGET","loader","loader2","sourceIn","cacheable","callback","async","sourcePath","resourcePath","includes","source","toString","options","platform","getOptions","shouldDisable","shouldPrintDebug","path","console","warn","info","cssPath","serializableOptions","key","extracted","extractToClassNames","styles","cssQuery","Buffer","from","remReq","remainingRequest","importPath","js","JSON","stringify","map","err","message","stack","String","error"],"sources":["loader.mjs"],"sourcesContent":["import * as StaticWorker from \"@tamagui/static-worker\";\nimport { requireResolve } from \"./requireResolve\";\n\nconst { getPragmaOptions } = StaticWorker;\nError.stackTraceLimit = Number.POSITIVE_INFINITY;\nlet CSS_LOADER_PATH = \"\";\ntry {\n\tCSS_LOADER_PATH = requireResolve(\"./css.cjs\");\n} catch {\n\ttry {\n\t\tCSS_LOADER_PATH = requireResolve(\"./css.esm\");\n\t} catch {\n\t\tCSS_LOADER_PATH = requireResolve(\"./css.js\");\n\t}\n}\nlet index = 0;\nprocess.env.TAMAGUI_TARGET = \"web\";\nconst loader = async function loader2(sourceIn) {\n\tthis.cacheable(true);\n\tconst callback = this.async();\n\tconst sourcePath = `${this.resourcePath}`;\n\tif (sourcePath.includes(\"node_modules\") || sourcePath.includes(\"lucide-icons\")) return callback(null, sourceIn);\n\tconst source = sourceIn.toString();\n\ttry {\n\t\tconst options = {\n\t\t\tplatform: \"web\",\n\t\t\t...this.getOptions()\n\t\t};\n\t\tconst { shouldDisable, shouldPrintDebug } = await getPragmaOptions({\n\t\t\tsource,\n\t\t\tpath: sourcePath\n\t\t});\n\t\tif (shouldPrintDebug === \"verbose\") {\n\t\t\tconsole.warn(`\n\n --- Incoming source --- \n\n`);\n\t\t\tconsole.warn(source);\n\t\t}\n\t\tif (shouldDisable) {\n\t\t\tif (shouldPrintDebug) console.info(\"Disabling on file via pragma\");\n\t\t\treturn callback(null, source);\n\t\t}\n\t\tconst cssPath = `${sourcePath}.${index++}.tamagui.css`;\n\t\tconst serializableOptions = { ...options };\n\t\tfor (const key in serializableOptions) if (typeof serializableOptions[key] === \"function\") delete serializableOptions[key];\n\t\tconst extracted = await StaticWorker.extractToClassNames({\n\t\t\tsource,\n\t\t\tsourcePath,\n\t\t\toptions: serializableOptions,\n\t\t\tshouldPrintDebug\n\t\t});\n\t\tif (!extracted) return callback(null, source);\n\t\tif (extracted.styles) {\n\t\t\tconst cssQuery = `cssData=${Buffer.from(extracted.styles).toString(\"base64\")}`;\n\t\t\tconst remReq = this.remainingRequest;\n\t\t\tconst importPath = `${cssPath}!=!${CSS_LOADER_PATH}?${cssQuery}!${remReq}`;\n\t\t\textracted.js = `${extracted.js}\n\nrequire(${JSON.stringify(importPath)})`;\n\t\t}\n\t\tcallback(null, extracted.js, extracted.map);\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? `${err.message}\n${err.stack}` : String(err);\n\t\tconsole.error(\"Tamagui Webpack Loader Error:\\n\", ` ${message}\n`);\n\t\tif (message.includes(\"Cannot create proxy\")) console.info(\"This is usually due to components not loading at build-time. Check for logs just below the line above:\");\n\t\tcallback(null, source);\n\t}\n};\n\nexport { loader };"],"mappings":"AAAA,OAAO,KAAKA,YAAY,MAAM,wBAAwB;AACtD,SAASC,cAAc,QAAQ,sBAAkB;AAEjD,MAAM;EAAEC;AAAiB,CAAC,GAAGF,YAAY;AACzCG,KAAK,CAACC,eAAe,GAAGC,MAAM,CAACC,iBAAiB;AAChD,IAAIC,eAAe,GAAG,EAAE;AACxB,IAAI;EACHA,eAAe,GAAGN,cAAc,CAAC,WAAW,CAAC;AAC9C,CAAC,CAAC,MAAM;EACP,IAAI;IACHM,eAAe,GAAGN,cAAc,CAAC,WAAW,CAAC;EAC9C,CAAC,CAAC,MAAM;IACPM,eAAe,GAAGN,cAAc,CAAC,UAAU,CAAC;EAC7C;AACD;AACA,IAAIO,KAAK,GAAG,CAAC;AACbC,OAAO,CAACC,GAAG,CAACC,cAAc,GAAG,KAAK;AAClC,MAAMC,MAAM,GAAG,eAAeC,OAAOA,CAACC,QAA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f,MAAM;MACNH,UAAU;MACVK,OAAO,EAAEU,mBAAmB;MAC5BN;IACD,CAAC,CAAC;IACF,IAAI,CAACQ,SAAS,EAAE,OAAOnB,QAAQ,CAAC,IAAI,EAAEK,MAAM,CAAC;IAC7C,IAAIc,SAAS,CAACE,MAAM,EAAE;MACrB,MAAMC,QAAQ,GAAG,WAAWC,MAAM,CAACC,IAAI,CAACL,SAAS,CAACE,MAAM,CAAC,CAACf,QAAQ,CAAC,QAAQ,CAAC,EAAE;MAC9E,MAAMmB,MAAM,GAAG,IAAI,CAACC,gBAAgB;MACpC,MAAMC,UAAU,GAAG,GAAGX,OAAO,MAAMzB,eAAe,IAAI+B,QAAQ,IAAIG,MAAM,EAAE;MAC1EN,SAAS,CAACS,EAAE,GAAG,GAAGT,SAAS,CAACS,EAAE;AACjC;AACA,UAAUC,IAAI,CAACC,SAAS,CAACH,UAAU,CAAC,GAAG;IACrC;IACA3B,QAAQ,CAAC,IAAI,EAAEmB,SAAS,CAACS,EAAE,EAAET,SAAS,CAACY,GAAG,CAAC;EAC5C,CAAC,CAAC,OAAOC,GAAG,EAAE;IACb,MAAMC,OAAO,GAAGD,GAAG,YAAY7C,KAAK,GAAG,GAAG6C,GAAG,CAACC,OAAO;AACvD,EAAED,GAAG,CAACE,KAAK,EAAE,GAAGC,MAAM,CAACH,GAAG,CAAC;IACzBnB,OAAO,CAACuB,KAAK,CAAC,iCAAiC,EAAE,KAAKH,OAAO;AAC/D,CAAC,CAAC;IACA,IAAIA,OAAO,CAAC7B,QAAQ,CAAC,qBAAqB,CAAC,EAAES,OAAO,CAACE,IAAI,CAAC,wGAAwG,CAAC;IACnKf,QAAQ,CAAC,IAAI,EAAEK,MAAM,CAAC;EACvB;AACD,CAAC;AAED,SAAST,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["StaticWorker","cssLoaderPath","getPragmaOptions","Error","stackTraceLimit","Number","POSITIVE_INFINITY","index","process","env","TAMAGUI_TARGET","loader","loader2","sourceIn","cacheable","callback","async","sourcePath","resourcePath","includes","source","toString","options","platform","getOptions","shouldDisable","shouldPrintDebug","path","console","warn","info","cssPath","serializableOptions","key","extracted","extractToClassNames","styles","importPath","Buffer","from","remainingRequest","js","JSON","stringify","map","err","message","stack","String","error"],"sources":["loader.mjs"],"sourcesContent":["import * as StaticWorker from \"@tamagui/static-worker\";\nimport { cssLoaderPath } from \"./css\";\n\nconst { getPragmaOptions } = StaticWorker;\nError.stackTraceLimit = Number.POSITIVE_INFINITY;\nlet index = 0;\nprocess.env.TAMAGUI_TARGET = \"web\";\nconst loader = async function loader2(sourceIn) {\n\tthis.cacheable(true);\n\tconst callback = this.async();\n\tconst sourcePath = `${this.resourcePath}`;\n\tif (sourcePath.includes(\"node_modules\") || sourcePath.includes(\"lucide-icons\")) return callback(null, sourceIn);\n\tconst source = sourceIn.toString();\n\ttry {\n\t\tconst options = {\n\t\t\tplatform: \"web\",\n\t\t\t...this.getOptions()\n\t\t};\n\t\tconst { shouldDisable, shouldPrintDebug } = await getPragmaOptions({\n\t\t\tsource,\n\t\t\tpath: sourcePath\n\t\t});\n\t\tif (shouldPrintDebug === \"verbose\") {\n\t\t\tconsole.warn(`\n\n --- Incoming source --- \n\n`);\n\t\t\tconsole.warn(source);\n\t\t}\n\t\tif (shouldDisable) {\n\t\t\tif (shouldPrintDebug) console.info(\"Disabling on file via pragma\");\n\t\t\treturn callback(null, source);\n\t\t}\n\t\tconst cssPath = `${sourcePath}.${index++}.tamagui.css`;\n\t\tconst serializableOptions = { ...options };\n\t\tfor (const key in serializableOptions) if (typeof serializableOptions[key] === \"function\") delete serializableOptions[key];\n\t\tconst extracted = await StaticWorker.extractToClassNames({\n\t\t\tsource,\n\t\t\tsourcePath,\n\t\t\toptions: serializableOptions,\n\t\t\tshouldPrintDebug\n\t\t});\n\t\tif (!extracted) return callback(null, source);\n\t\tif (extracted.styles) {\n\t\t\tconst importPath = `${cssPath}!=!${cssLoaderPath}?${`cssData=${Buffer.from(extracted.styles).toString(\"base64\")}`}!${this.remainingRequest}`;\n\t\t\textracted.js = `${extracted.js}\n\nrequire(${JSON.stringify(importPath)})`;\n\t\t}\n\t\tcallback(null, extracted.js, extracted.map);\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? `${err.message}\n${err.stack}` : String(err);\n\t\tconsole.error(\"Tamagui Webpack Loader Error:\\n\", ` ${message}\n`);\n\t\tif (message.includes(\"Cannot create proxy\")) console.info(\"This is usually due to components not loading at build-time. Check for logs just below the line above:\");\n\t\tcallback(null, source);\n\t}\n};\n\nexport { loader };"],"mappings":"AAAA,OAAO,KAAKA,YAAY,MAAM,wBAAwB;AACtD,SAASC,aAAa,QAAQ,WAAO;AAErC,MAAM;EAAEC;AAAiB,CAAC,GAAGF,YAAY;AACzCG,KAAK,CAACC,eAAe,GAAGC,MAAM,CAACC,iBAAiB;AAChD,IAAIC,KAAK,GAAG,CAAC;AACbC,OAAO,CAACC,GAAG,CAACC,cAAc,GAAG,KAAK;AAClC,MAAMC,MAAM,GAAG,eAAeC,OAAOA,CAACC,QAAQ,EAAE;EAC/C,IAAI,CAACC,SAAS,CAAC,IAAI,CAAC;EACpB,MAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;EAC7B,MAAMC,UAAU,GAAG,GAAG,IAAI,CAACC,YAAY,EAAE;EACzC,IAAID,UAAU,CAACE,QAAQ,CAAC,cAAc,CAAC,IAAIF,UAAU,CAACE,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAOJ,QAAQ,CAAC,IAAI,EAAEF,QAAQ,CAAC;EAC/G,MAAMO,MAAM,GAAGP,QAAQ,CAACQ,QAAQ,CAAC,CAAC;EAClC,IAAI;IACH,MAAMC,OAAO,GAAG;MACfC,QAAQ,EAAE,KAAK;MACf,GAAG,IAAI,CAACC,UAAU,CAAC;IACpB,CAAC;IACD,MAAM;MAAEC,aAAa;MAAEC;IAAiB,CAAC,GAAG,MAAMxB,gBAAgB,CAAC;MAClEkB,MAAM;MACNO,IAAI,EAAE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5C,CAAC,CAAC,OAAOC,GAAG,EAAE;IACb,MAAMC,OAAO,GAAGD,GAAG,YAAY1C,KAAK,GAAG,GAAG0C,GAAG,CAACC,OAAO;AACvD,EAAED,GAAG,CAACE,KAAK,EAAE,GAAGC,MAAM,CAACH,GAAG,CAAC;IACzBjB,OAAO,CAACqB,KAAK,CAAC,iCAAiC,EAAE,KAAKH,OAAO;AAC/D,CAAC,CAAC;IACA,IAAIA,OAAO,CAAC3B,QAAQ,CAAC,qBAAqB,CAAC,EAAES,OAAO,CAACE,IAAI,CAAC,wGAAwG,CAAC;IACnKf,QAAQ,CAAC,IAAI,EAAEK,MAAM,CAAC;EACvB;AACD,CAAC;AAED,SAAST,MAAM","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamagui-loader",
3
- "version": "2.7.6",
3
+ "version": "2.7.7-1788328229285",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "files": [
6
6
  "src",
@@ -32,19 +32,19 @@
32
32
  "clean:build": "tamagui-build clean:build"
33
33
  },
34
34
  "dependencies": {
35
- "@tamagui/cli-color": "2.7.6",
36
- "@tamagui/core": "2.7.6",
37
- "@tamagui/static": "2.7.6",
38
- "@tamagui/static-worker": "2.7.6",
39
- "@tamagui/types": "2.7.6",
40
- "@tamagui/web": "2.7.6",
35
+ "@tamagui/cli-color": "2.7.7-1788328229285",
36
+ "@tamagui/core": "2.7.7-1788328229285",
37
+ "@tamagui/static": "2.7.7-1788328229285",
38
+ "@tamagui/static-worker": "2.7.7-1788328229285",
39
+ "@tamagui/types": "2.7.7-1788328229285",
40
+ "@tamagui/web": "2.7.7-1788328229285",
41
41
  "esbuild-loader": "^4.2.2",
42
42
  "esm-resolve": "^1.0.8",
43
43
  "fs-extra": "^11.2.0",
44
44
  "loader-utils": "^3.2.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@tamagui/build": "2.7.6",
47
+ "@tamagui/build": "2.7.7-1788328229285",
48
48
  "prettyjson": "^1.2.5",
49
49
  "webpack": "^5.88.2"
50
50
  },
package/src/css.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import type { TamaguiOptions } from '@tamagui/static'
2
2
  import type { LoaderContext } from 'webpack'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ export const cssLoaderPath =
6
+ 'url' in import.meta ? fileURLToPath(import.meta.url) : __filename
3
7
 
4
8
  export default function loader(this: LoaderContext<TamaguiOptions>) {
5
9
  this.async()
package/src/loader.ts CHANGED
@@ -1,25 +1,12 @@
1
1
  import * as StaticWorker from '@tamagui/static-worker'
2
2
  import type { TamaguiOptions } from '@tamagui/types'
3
3
  import type { LoaderContext } from 'webpack'
4
- import { requireResolve } from './requireResolve'
4
+ import { cssLoaderPath } from './css'
5
5
 
6
6
  const { getPragmaOptions } = StaticWorker
7
7
 
8
8
  Error.stackTraceLimit = Number.POSITIVE_INFINITY
9
9
 
10
- // pass loader as path
11
- let CSS_LOADER_PATH = ''
12
-
13
- try {
14
- CSS_LOADER_PATH = requireResolve('./css.cjs')
15
- } catch {
16
- try {
17
- CSS_LOADER_PATH = requireResolve('./css.esm')
18
- } catch {
19
- CSS_LOADER_PATH = requireResolve('./css.js')
20
- }
21
- }
22
-
23
10
  let index = 0
24
11
 
25
12
  process.env.TAMAGUI_TARGET = 'web'
@@ -88,7 +75,7 @@ export const loader = async function loader(
88
75
  if (extracted.styles) {
89
76
  const cssQuery = `cssData=${Buffer.from(extracted.styles).toString('base64')}`
90
77
  const remReq = this.remainingRequest
91
- const importPath = `${cssPath}!=!${CSS_LOADER_PATH}?${cssQuery}!${remReq}`
78
+ const importPath = `${cssPath}!=!${cssLoaderPath}?${cssQuery}!${remReq}`
92
79
  extracted.js = `${extracted.js}\n\nrequire(${JSON.stringify(importPath)})`
93
80
  }
94
81
 
package/types/css.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { TamaguiOptions } from '@tamagui/static';
2
2
  import type { LoaderContext } from 'webpack';
3
+ export declare const cssLoaderPath: string;
3
4
  export default function loader(this: LoaderContext<TamaguiOptions>): void;
4
5
  //# sourceMappingURL=css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC,QASjE"}
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,eAAO,MAAM,aAAa,QAC0C,CAAA;AAEpE,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,cAAc,CAAC,QASjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAwB5C,eAAO,MAAM,MAAM,GACjB,MAAM,aAAa,CAAC,cAAc,CAAC,EACnC,UAAU,MAAM,GAAG,MAAM,kBAgF1B,CAAA"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAW5C,eAAO,MAAM,MAAM,GACjB,MAAM,aAAa,CAAC,cAAc,CAAC,EACnC,UAAU,MAAM,GAAG,MAAM,kBAgF1B,CAAA"}