tamagui-loader 1.41.1 → 1.42.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamagui-loader",
3
- "version": "1.41.1",
3
+ "version": "1.42.1",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -18,14 +18,14 @@
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "dependencies": {
21
- "@tamagui/cli-color": "1.41.1",
22
- "@tamagui/static": "1.41.1",
21
+ "@tamagui/cli-color": "1.42.1",
22
+ "@tamagui/static": "1.42.1",
23
23
  "fs-extra": "^11.1.0",
24
24
  "loader-utils": "^3.2.1",
25
25
  "lodash": "^4.17.21"
26
26
  },
27
27
  "devDependencies": {
28
- "@tamagui/build": "1.41.1",
28
+ "@tamagui/build": "1.42.1",
29
29
  "prettyjson": "^1.2.5",
30
30
  "webpack": "^5.83.1"
31
31
  },
@@ -1,126 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var plugin_exports = {};
30
- __export(plugin_exports, {
31
- TamaguiPlugin: () => TamaguiPlugin
32
- });
33
- module.exports = __toCommonJS(plugin_exports);
34
- class TamaguiPlugin {
35
- constructor(options = {
36
- components: ["@tamagui/core"]
37
- }) {
38
- this.options = options;
39
- this.pluginName = "TamaguiPlugin";
40
- }
41
- apply(compiler) {
42
- var _a;
43
- compiler.hooks.normalModuleFactory.tap(this.pluginName, (nmf) => {
44
- nmf.hooks.createModule.tap(
45
- this.pluginName,
46
- // @ts-expect-error CreateData is typed as 'object'...
47
- (createData) => {
48
- var _a2;
49
- if ((_a2 = createData.matchResource) == null ? void 0 : _a2.endsWith(".tamagui.css")) {
50
- createData.settings.sideEffects = true;
51
- }
52
- }
53
- );
54
- });
55
- compiler.options.resolve.extensions = [
56
- .../* @__PURE__ */ new Set([
57
- ".web.tsx",
58
- ".web.ts",
59
- ".web.js",
60
- ".ts",
61
- ".tsx",
62
- ".js",
63
- ...compiler.options.resolve.extensions || []
64
- ])
65
- ];
66
- const mainFields = compiler.options.resolve.mainFields;
67
- if (mainFields) {
68
- compiler.options.resolve.mainFields = Array.isArray(mainFields) ? mainFields : [mainFields];
69
- mainFields.unshift("module:jsx");
70
- }
71
- if (!compiler.options.module) {
72
- return;
73
- }
74
- const { jsLoader } = this.options;
75
- const existing = compiler.options.module.rules;
76
- const rules = ((_a = existing.find((x) => typeof x === "object" && "oneOf" in x ? x : null)) == null ? void 0 : _a.oneOf) ?? existing;
77
- const nextJsRules = rules.findIndex(
78
- (x) => (x == null ? void 0 : x.use) && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api"
79
- );
80
- const startIndex = nextJsRules ? nextJsRules + 1 : 0;
81
- const existingLoader = nextJsRules ? rules[startIndex] : void 0;
82
- rules.splice(startIndex, 0, {
83
- test: this.options.test ?? /\.m?[jt]sx?$/,
84
- exclude: this.options.exclude,
85
- resolve: {
86
- fullySpecified: false
87
- },
88
- use: [
89
- ...jsLoader ? [jsLoader] : [],
90
- ...existingLoader && nextJsRules ? [].concat(existingLoader.use) : [],
91
- ...!(jsLoader || existingLoader) ? [
92
- {
93
- loader: require.resolve("esbuild-loader"),
94
- options: {
95
- target: "es2021",
96
- keepNames: true,
97
- loader: {
98
- ".tsx": "tsx",
99
- ".png": "copy",
100
- ".jpg": "copy",
101
- ".gif": "copy"
102
- },
103
- tsconfigRaw: {
104
- module: this.options.commonjs ? "commonjs" : "esnext",
105
- isolatedModules: true,
106
- jsx: "preserve",
107
- resolveJsonModule: true
108
- }
109
- }
110
- }
111
- ] : [],
112
- {
113
- loader: require.resolve("tamagui-loader"),
114
- options: {
115
- ...this.options
116
- }
117
- }
118
- ]
119
- });
120
- }
121
- }
122
- // Annotate the CommonJS export names for ESM import in node:
123
- 0 && (module.exports = {
124
- TamaguiPlugin
125
- });
126
- //# sourceMappingURL=plugin.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/plugin.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,cAAc;AAAA,EAGzB,YACS,UAAyB;AAAA,IAC9B,YAAY,CAAC,eAAe;AAAA,EAC9B,GACA;AAHO;AAHT,sBAAa;AAAA,EAMV;AAAA,EAEH,MAAM,UAAoB;AAnB5B;AAqBI,aAAS,MAAM,oBAAoB,IAAI,KAAK,YAAY,CAAC,QAAQ;AAC/D,UAAI,MAAM,aAAa;AAAA,QACrB,KAAK;AAAA;AAAA,QAEL,CAAC,eAAgF;AAzBzF,cAAAA;AA0BU,eAAIA,MAAA,W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,GAAI,EAAE,YAAY,kBACd;AAAA,UACE;AAAA,YACE,QAAQ,gBAAgB,gBAAgB;AAAA,YACxC,SAAS;AAAA,cACP,QAAQ;AAAA,cACR,WAAW;AAAA,cACX,QAAQ;AAAA,gBACN,QAAQ;AAAA,gBACR,QAAQ;AAAA,gBACR,QAAQ;AAAA,gBACR,QAAQ;AAAA,cACV;AAAA,cAEA,aAAa;AAAA,gBACX,QAAQ,KAAK,QAAQ,WAAW,aAAa;AAAA,gBAC7C,iBAAiB;AAAA,gBACjB,KAAK;AAAA,gBACL,mBAAmB;AAAA,cACrB;AAAA,YACF;AAAA,UACF;AAAA,QACF,IACA,CAAC;AAAA,QACL;AAAA,UACE,QAAQ,gBAAgB,gBAAgB;AAAA,UACxC,SAAS;AAAA,YACP,GAAG,KAAK;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
5
- "names": ["_a"]
6
- }
@@ -1,92 +0,0 @@
1
- class TamaguiPlugin {
2
- constructor(options = {
3
- components: ["@tamagui/core"]
4
- }) {
5
- this.options = options;
6
- this.pluginName = "TamaguiPlugin";
7
- }
8
- apply(compiler) {
9
- var _a;
10
- compiler.hooks.normalModuleFactory.tap(this.pluginName, (nmf) => {
11
- nmf.hooks.createModule.tap(
12
- this.pluginName,
13
- // @ts-expect-error CreateData is typed as 'object'...
14
- (createData) => {
15
- var _a2;
16
- if ((_a2 = createData.matchResource) == null ? void 0 : _a2.endsWith(".tamagui.css")) {
17
- createData.settings.sideEffects = true;
18
- }
19
- }
20
- );
21
- });
22
- compiler.options.resolve.extensions = [
23
- .../* @__PURE__ */ new Set([
24
- ".web.tsx",
25
- ".web.ts",
26
- ".web.js",
27
- ".ts",
28
- ".tsx",
29
- ".js",
30
- ...compiler.options.resolve.extensions || []
31
- ])
32
- ];
33
- const mainFields = compiler.options.resolve.mainFields;
34
- if (mainFields) {
35
- compiler.options.resolve.mainFields = Array.isArray(mainFields) ? mainFields : [mainFields];
36
- mainFields.unshift("module:jsx");
37
- }
38
- if (!compiler.options.module) {
39
- return;
40
- }
41
- const { jsLoader } = this.options;
42
- const existing = compiler.options.module.rules;
43
- const rules = ((_a = existing.find((x) => typeof x === "object" && "oneOf" in x ? x : null)) == null ? void 0 : _a.oneOf) ?? existing;
44
- const nextJsRules = rules.findIndex(
45
- (x) => (x == null ? void 0 : x.use) && x.use.loader === "next-swc-loader" && x.issuerLayer !== "api"
46
- );
47
- const startIndex = nextJsRules ? nextJsRules + 1 : 0;
48
- const existingLoader = nextJsRules ? rules[startIndex] : void 0;
49
- rules.splice(startIndex, 0, {
50
- test: this.options.test ?? /\.m?[jt]sx?$/,
51
- exclude: this.options.exclude,
52
- resolve: {
53
- fullySpecified: false
54
- },
55
- use: [
56
- ...jsLoader ? [jsLoader] : [],
57
- ...existingLoader && nextJsRules ? [].concat(existingLoader.use) : [],
58
- ...!(jsLoader || existingLoader) ? [
59
- {
60
- loader: require.resolve("esbuild-loader"),
61
- options: {
62
- target: "es2021",
63
- keepNames: true,
64
- loader: {
65
- ".tsx": "tsx",
66
- ".png": "copy",
67
- ".jpg": "copy",
68
- ".gif": "copy"
69
- },
70
- tsconfigRaw: {
71
- module: this.options.commonjs ? "commonjs" : "esnext",
72
- isolatedModules: true,
73
- jsx: "preserve",
74
- resolveJsonModule: true
75
- }
76
- }
77
- }
78
- ] : [],
79
- {
80
- loader: require.resolve("tamagui-loader"),
81
- options: {
82
- ...this.options
83
- }
84
- }
85
- ]
86
- });
87
- }
88
- }
89
- export {
90
- TamaguiPlugin
91
- };
92
- //# sourceMappingURL=plugin.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/plugin.ts"],
4
- "mappings": "AAUO,MAAM,cAAc;AAAA,EAGzB,YACS,UAAyB;AAAA,IAC9B,YAAY,CAAC,eAAe;AAAA,EAC9B,GACA;AAHO;AAHT,sBAAa;AAAA,EAMV;AAAA,EAEH,MAAM,UAAoB;AAnB5B;AAqBI,a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