tailwind-styled-v4 1.0.1 → 4.0.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/dist/animate.cjs +252 -0
- package/dist/animate.cjs.map +1 -0
- package/dist/animate.d.cts +117 -0
- package/dist/animate.d.ts +117 -0
- package/dist/animate.js +245 -0
- package/dist/animate.js.map +1 -0
- package/dist/astTransform-ua-eapqs.d.cts +41 -0
- package/dist/astTransform-ua-eapqs.d.ts +41 -0
- package/dist/compiler.cjs +3594 -0
- package/dist/compiler.cjs.map +1 -0
- package/dist/compiler.d.cts +716 -0
- package/dist/compiler.d.ts +716 -0
- package/dist/compiler.js +3535 -0
- package/dist/compiler.js.map +1 -0
- package/dist/css.cjs +71 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +45 -0
- package/dist/css.d.ts +45 -0
- package/dist/css.js +62 -0
- package/dist/css.js.map +1 -0
- package/dist/devtools.cjs +959 -0
- package/dist/devtools.cjs.map +1 -0
- package/dist/devtools.d.cts +22 -0
- package/dist/devtools.d.ts +22 -0
- package/dist/devtools.js +952 -0
- package/dist/devtools.js.map +1 -0
- package/dist/index.cjs +1058 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +584 -0
- package/dist/index.d.ts +449 -980
- package/dist/index.js +1021 -3
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +268 -0
- package/dist/next.cjs.map +1 -0
- package/dist/next.d.cts +45 -0
- package/dist/next.d.ts +45 -0
- package/dist/next.js +261 -0
- package/dist/next.js.map +1 -0
- package/dist/plugins.cjs +396 -0
- package/dist/plugins.cjs.map +1 -0
- package/dist/plugins.d.cts +231 -0
- package/dist/plugins.d.ts +231 -0
- package/dist/plugins.js +381 -0
- package/dist/plugins.js.map +1 -0
- package/dist/preset.cjs +129 -0
- package/dist/preset.cjs.map +1 -0
- package/dist/preset.d.cts +249 -0
- package/dist/preset.d.ts +249 -0
- package/dist/preset.js +124 -0
- package/dist/preset.js.map +1 -0
- package/dist/theme.cjs +154 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +181 -0
- package/dist/theme.d.ts +181 -0
- package/dist/theme.js +148 -0
- package/dist/theme.js.map +1 -0
- package/dist/turbopackLoader.cjs +2689 -0
- package/dist/turbopackLoader.cjs.map +1 -0
- package/dist/turbopackLoader.d.cts +22 -0
- package/dist/turbopackLoader.d.ts +22 -0
- package/dist/turbopackLoader.js +2681 -0
- package/dist/turbopackLoader.js.map +1 -0
- package/dist/vite.cjs +105 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.cts +22 -0
- package/dist/vite.d.ts +22 -0
- package/dist/vite.js +96 -0
- package/dist/vite.js.map +1 -0
- package/dist/webpackLoader.cjs +2670 -0
- package/dist/webpackLoader.cjs.map +1 -0
- package/dist/webpackLoader.d.cts +24 -0
- package/dist/webpackLoader.d.ts +24 -0
- package/dist/webpackLoader.js +2662 -0
- package/dist/webpackLoader.js.map +1 -0
- package/package.json +62 -32
- package/CHANGELOG.md +0 -75
- package/LICENSE +0 -21
- package/README.md +0 -608
- package/dist/cli/init.js +0 -208
- package/dist/compiler/index.d.mts +0 -214
- package/dist/compiler/index.d.ts +0 -214
- package/dist/compiler/index.js +0 -546
- package/dist/compiler/index.js.map +0 -1
- package/dist/compiler/index.mjs +0 -504
- package/dist/compiler/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -1115
- package/dist/index.mjs +0 -4
- package/dist/index.mjs.map +0 -1
- package/dist/turbopack-loader.js +0 -232
- package/dist/webpack-loader.js +0 -213
package/dist/next.cjs
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var fs = require('fs');
|
|
4
|
+
var path = require('path');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
9
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
10
|
+
|
|
11
|
+
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __defProps = Object.defineProperties;
|
|
14
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
15
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
16
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
18
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19
|
+
var __spreadValues = (a, b) => {
|
|
20
|
+
for (var prop in b || (b = {}))
|
|
21
|
+
if (__hasOwnProp.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
if (__getOwnPropSymbols)
|
|
24
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
25
|
+
if (__propIsEnum.call(b, prop))
|
|
26
|
+
__defNormalProp(a, prop, b[prop]);
|
|
27
|
+
}
|
|
28
|
+
return a;
|
|
29
|
+
};
|
|
30
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
31
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
32
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
33
|
+
}) : x)(function(x) {
|
|
34
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
35
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
36
|
+
});
|
|
37
|
+
var LOADER_PATH = __require.resolve("./turbopackLoader");
|
|
38
|
+
var WEBPACK_LOADER_PATH = __require.resolve("./webpackLoader");
|
|
39
|
+
function withTailwindStyled(opts = {}) {
|
|
40
|
+
return (nextConfig = {}) => {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
const cwd = process.cwd();
|
|
43
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
44
|
+
const hasReactCompiler = nextConfig.reactCompiler === true || ((_a = nextConfig.experimental) == null ? void 0 : _a.reactCompiler) === true;
|
|
45
|
+
if (hasReactCompiler && isDev) {
|
|
46
|
+
console.log("[tailwind-styled-v4] React Compiler detected \u2192 hoist disabled");
|
|
47
|
+
}
|
|
48
|
+
const {
|
|
49
|
+
scanDirs = ["src"],
|
|
50
|
+
safelistOutput = "src/app/__tw-safelist.css",
|
|
51
|
+
autoClientBoundary = true,
|
|
52
|
+
hoist = !hasReactCompiler,
|
|
53
|
+
atomic = false,
|
|
54
|
+
routeCssDir = path__default.default.join(cwd, ".next", "static", "css", "tw"),
|
|
55
|
+
zeroConfig = true,
|
|
56
|
+
plugins = [],
|
|
57
|
+
devtools = isDev,
|
|
58
|
+
staticVariants = !isDev,
|
|
59
|
+
deadStyleElimination = !isDev
|
|
60
|
+
} = opts;
|
|
61
|
+
const routeCss = opts.routeCss !== void 0 ? opts.routeCss : !isDev;
|
|
62
|
+
if (zeroConfig) {
|
|
63
|
+
try {
|
|
64
|
+
const { bootstrapZeroConfig } = __require("@tailwind-styled/compiler");
|
|
65
|
+
bootstrapZeroConfig(cwd);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const safelistAbsPath = path__default.default.isAbsolute(safelistOutput) ? safelistOutput : path__default.default.resolve(cwd, safelistOutput);
|
|
70
|
+
if (!fs__default.default.existsSync(safelistAbsPath)) {
|
|
71
|
+
try {
|
|
72
|
+
fs__default.default.mkdirSync(path__default.default.dirname(safelistAbsPath), { recursive: true });
|
|
73
|
+
fs__default.default.writeFileSync(
|
|
74
|
+
safelistAbsPath,
|
|
75
|
+
"/* Auto-generated by tailwind-styled-v4 \u2014 DO NOT EDIT */\n"
|
|
76
|
+
);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (plugins.length > 0) {
|
|
81
|
+
try {
|
|
82
|
+
const { use } = __require("@tailwind-styled/plugin");
|
|
83
|
+
for (const plugin of plugins) use(plugin);
|
|
84
|
+
console.log(
|
|
85
|
+
`[tailwind-styled-v4] ${plugins.length} plugin(s): ${plugins.map((p) => p.name).join(", ")}`
|
|
86
|
+
);
|
|
87
|
+
} catch (e) {
|
|
88
|
+
console.warn("[tailwind-styled-v4] Plugin init failed:", e);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const loaderOpts = {
|
|
92
|
+
mode: opts.mode,
|
|
93
|
+
addDataAttr: (_b = opts.addDataAttr) != null ? _b : isDev,
|
|
94
|
+
autoClientBoundary,
|
|
95
|
+
hoist,
|
|
96
|
+
atomic,
|
|
97
|
+
routeCss,
|
|
98
|
+
staticVariants
|
|
99
|
+
};
|
|
100
|
+
return __spreadProps(__spreadValues({}, nextConfig), {
|
|
101
|
+
experimental: __spreadValues({}, nextConfig.experimental),
|
|
102
|
+
// Next.js 16+: turbopack moved to top-level
|
|
103
|
+
// FIX TURBOPACK: pattern "*.{tsx,ts,jsx,js}" terlalu lebar — ikut match
|
|
104
|
+
// node_modules/next/dist/client/*.js.tsx dan trigger "Missing module type".
|
|
105
|
+
// Solusi: scope pattern ke scanDirs saja, jangan catch-all.
|
|
106
|
+
// `as` field dihapus — tidak perlu karena loader output tetap TSX-compatible.
|
|
107
|
+
turbopack: __spreadProps(__spreadValues({}, nextConfig.turbopack), {
|
|
108
|
+
rules: __spreadValues(__spreadValues({}, Object.fromEntries(
|
|
109
|
+
scanDirs.flatMap((dir) => [
|
|
110
|
+
[
|
|
111
|
+
`{./${dir},./src,./app,./pages,./components}/**/*.tsx`,
|
|
112
|
+
{
|
|
113
|
+
loaders: [{ loader: LOADER_PATH, options: loaderOpts }]
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
`{./${dir},./src,./app,./pages,./components}/**/*.ts`,
|
|
118
|
+
{
|
|
119
|
+
loaders: [{ loader: LOADER_PATH, options: loaderOpts }]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
])
|
|
123
|
+
)), (_c = nextConfig.turbopack) == null ? void 0 : _c.rules)
|
|
124
|
+
}),
|
|
125
|
+
webpack(webpackConfig, webpackOpts) {
|
|
126
|
+
var _a2, _b2, _c2, _d;
|
|
127
|
+
const alreadyRegistered = webpackConfig.module.rules.some(
|
|
128
|
+
(r) => r._tailwindStyledMarker === true
|
|
129
|
+
);
|
|
130
|
+
if (!alreadyRegistered) {
|
|
131
|
+
webpackConfig.module.rules.push({
|
|
132
|
+
_tailwindStyledMarker: true,
|
|
133
|
+
test: /\.(tsx|ts|jsx|js)$/,
|
|
134
|
+
exclude: /node_modules/,
|
|
135
|
+
use: [
|
|
136
|
+
{
|
|
137
|
+
loader: WEBPACK_LOADER_PATH,
|
|
138
|
+
options: __spreadProps(__spreadValues({}, loaderOpts), {
|
|
139
|
+
mode: (_a2 = opts.mode) != null ? _a2 : webpackOpts.dev ? "runtime" : "zero-runtime",
|
|
140
|
+
addDataAttr: (_b2 = opts.addDataAttr) != null ? _b2 : webpackOpts.dev
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (devtools && webpackOpts.dev) {
|
|
147
|
+
webpackConfig.resolve = (_c2 = webpackConfig.resolve) != null ? _c2 : {};
|
|
148
|
+
webpackConfig.resolve.alias = __spreadProps(__spreadValues({}, (_d = webpackConfig.resolve.alias) != null ? _d : {}), {
|
|
149
|
+
"tailwind-styled-v4/devtools": path__default.default.resolve(__dirname, "../../devtools/src/index.tsx")
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return typeof nextConfig.webpack === "function" ? nextConfig.webpack(webpackConfig, webpackOpts) : webpackConfig;
|
|
153
|
+
},
|
|
154
|
+
generateBuildId: async () => {
|
|
155
|
+
try {
|
|
156
|
+
const { generateSafelistCss } = __require("@tailwind-styled/compiler");
|
|
157
|
+
generateSafelistCss(
|
|
158
|
+
scanDirs.map((d) => path__default.default.resolve(cwd, d)),
|
|
159
|
+
path__default.default.isAbsolute(safelistOutput) ? safelistOutput : path__default.default.resolve(cwd, safelistOutput)
|
|
160
|
+
);
|
|
161
|
+
console.log("[tailwind-styled-v4] \u2713 Safelist CSS generated");
|
|
162
|
+
} catch (e) {
|
|
163
|
+
console.warn("[tailwind-styled-v4] Safelist skipped:", e);
|
|
164
|
+
}
|
|
165
|
+
if (plugins.length > 0) {
|
|
166
|
+
try {
|
|
167
|
+
const { getGlobalRegistry, runBuildHooks } = __require("@tailwind-styled/plugin");
|
|
168
|
+
await runBuildHooks(getGlobalRegistry());
|
|
169
|
+
console.log("[tailwind-styled-v4] \u2713 Plugin build hooks complete");
|
|
170
|
+
} catch (e) {
|
|
171
|
+
console.warn("[tailwind-styled-v4] Plugin build hooks failed:", e);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (routeCss) {
|
|
175
|
+
try {
|
|
176
|
+
const {
|
|
177
|
+
generateAllRouteCss,
|
|
178
|
+
getCollectorSummary,
|
|
179
|
+
runElimination
|
|
180
|
+
} = __require("@tailwind-styled/compiler");
|
|
181
|
+
const results = await generateAllRouteCss({ cwd, outputDir: routeCssDir, minify: true });
|
|
182
|
+
console.log(getCollectorSummary());
|
|
183
|
+
if (deadStyleElimination) {
|
|
184
|
+
let totalSaved = 0;
|
|
185
|
+
for (const result of results) {
|
|
186
|
+
const routeFile = path__default.default.join(
|
|
187
|
+
routeCssDir,
|
|
188
|
+
result.route === "/" ? "index.css" : `${result.route.replace(/\//g, "_")}.css`
|
|
189
|
+
);
|
|
190
|
+
if (fs__default.default.existsSync(routeFile)) {
|
|
191
|
+
const inputCss = fs__default.default.readFileSync(routeFile, "utf-8");
|
|
192
|
+
const { css, report } = runElimination({ dirs: scanDirs, cwd, inputCss });
|
|
193
|
+
fs__default.default.writeFileSync(routeFile, css);
|
|
194
|
+
totalSaved += report.bytesSaved;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (totalSaved > 0) {
|
|
198
|
+
console.log(
|
|
199
|
+
`[tailwind-styled-v4] \u2713 Dead styles eliminated: ~${(totalSaved / 1024).toFixed(1)}KB saved`
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const totalKb = results.reduce((s, r) => s + r.sizeBytes, 0) / 1024;
|
|
204
|
+
console.log(
|
|
205
|
+
`[tailwind-styled-v4] \u2713 Route CSS: ${results.length} routes, ${totalKb.toFixed(1)}KB`
|
|
206
|
+
);
|
|
207
|
+
} catch (e) {
|
|
208
|
+
console.warn("[tailwind-styled-v4] Route CSS skipped:", e);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (plugins.length > 0) {
|
|
212
|
+
try {
|
|
213
|
+
const {
|
|
214
|
+
getGlobalRegistry,
|
|
215
|
+
generateTokenCss,
|
|
216
|
+
generateUtilityCss,
|
|
217
|
+
applyCssHooks
|
|
218
|
+
} = __require("@tailwind-styled/plugin");
|
|
219
|
+
const registry = getGlobalRegistry();
|
|
220
|
+
let pluginCss = [generateTokenCss(registry), generateUtilityCss(registry)].filter(Boolean).join("\n\n");
|
|
221
|
+
pluginCss = applyCssHooks(pluginCss, registry);
|
|
222
|
+
if (pluginCss.trim()) {
|
|
223
|
+
const outPath = path__default.default.join(cwd, "public", "__tw-plugins.css");
|
|
224
|
+
fs__default.default.mkdirSync(path__default.default.dirname(outPath), { recursive: true });
|
|
225
|
+
fs__default.default.writeFileSync(outPath, pluginCss);
|
|
226
|
+
console.log("[tailwind-styled-v4] \u2713 Plugin CSS \u2192 public/__tw-plugins.css");
|
|
227
|
+
}
|
|
228
|
+
} catch (e) {
|
|
229
|
+
console.warn("[tailwind-styled-v4] Plugin CSS skipped:", e);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const { incremental = true, styleBuckets = true, incrementalVerbose = false } = opts;
|
|
233
|
+
if (incremental) {
|
|
234
|
+
try {
|
|
235
|
+
const { getIncrementalEngine, getBucketEngine } = __require("@tailwind-styled/compiler");
|
|
236
|
+
const engine = getIncrementalEngine({ verbose: incrementalVerbose });
|
|
237
|
+
engine.buildEndSync();
|
|
238
|
+
const stats = engine.getStats();
|
|
239
|
+
console.log(
|
|
240
|
+
`[tailwind-styled-v4] \u2713 Incremental: ${stats.changedFiles}/${stats.totalFiles} files changed | +${stats.addedRules} -${stats.removedRules} rules | ${stats.buildTimeMs}ms`
|
|
241
|
+
);
|
|
242
|
+
if (styleBuckets) {
|
|
243
|
+
const buckets = getBucketEngine();
|
|
244
|
+
const allNodes = engine.getAllNodes();
|
|
245
|
+
for (const node of allNodes) buckets.add(node);
|
|
246
|
+
const css = buckets.emit();
|
|
247
|
+
const outPath = path__default.default.join(cwd, "public", "__tw-atomic.css");
|
|
248
|
+
fs__default.default.mkdirSync(path__default.default.dirname(outPath), { recursive: true });
|
|
249
|
+
fs__default.default.writeFileSync(outPath, css);
|
|
250
|
+
const bStats = buckets.stats();
|
|
251
|
+
console.log(
|
|
252
|
+
`[tailwind-styled-v4] \u2713 Bucket CSS \u2192 public/__tw-atomic.css | ${bStats.totalNodes} rules`
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
} catch (e) {
|
|
256
|
+
console.warn("[tailwind-styled-v4] Incremental engine flush skipped:", e);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (typeof nextConfig.generateBuildId === "function") return nextConfig.generateBuildId();
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
exports.withTailwindStyled = withTailwindStyled;
|
|
267
|
+
//# sourceMappingURL=next.cjs.map
|
|
268
|
+
//# sourceMappingURL=next.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../next/src/withTailwindStyled.ts"],"names":["path","fs","_a","_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A,EAAuC,KAAA,CAAM,YAAY,CAAA,CAAA,EAAI,MAAM,UAAU,CAAA,kBAAA,EACvE,KAAA,CAAM,UAAU,CAAA,EAAA,EAAK,KAAA,CAAM,YAAY,CAAA,SAAA,EAAY,MAAM,WAAW,CAAA,EAAA;AAAA,aAC5E;AAEA,YAAA,IAAI,YAAA,EAAc;AAChB,cAAA,MAAM,UAAU,eAAA,EAAgB;AAChC,cAAA,MAAM,QAAA,GAAW,OAAO,WAAA,EAAY;AACpC,cAAA,KAAA,MAAW,IAAA,IAAQ,QAAA,EAAU,OAAA,CAAQ,GAAA,CAAI,IAAI,CAAA;AAC7C,cAAA,MAAM,GAAA,GAAM,QAAQ,IAAA,EAAK;AACzB,cAAA,MAAM,OAAA,GAAUD,qBAAA,CAAK,IAAA,CAAK,GAAA,EAAK,UAAU,iBAAiB,CAAA;AAC1D,cAAAC,mBAAA,CAAG,SAAA,CAAUD,sBAAK,OAAA,CAAQ,OAAO,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AACvD,cAAAC,mBAAA,CAAG,aAAA,CAAc,SAAS,GAAG,CAAA;AAC7B,cAAA,MAAM,MAAA,GAAS,QAAQ,KAAA,EAAM;AAC7B,cAAA,OAAA,CAAQ,GAAA;AAAA,gBACN,CAAA,uEAAA,EACK,OAAO,UAAU,CAAA,MAAA;AAAA,eACxB;AAAA,YACF;AAAA,UACF,SAAS,CAAA,EAAG;AACV,YAAA,OAAA,CAAQ,IAAA,CAAK,0DAA0D,CAAC,CAAA;AAAA,UAC1E;AAAA,QACF;AAEA,QAAA,IAAI,OAAO,UAAA,CAAW,eAAA,KAAoB,UAAA,EAAY,OAAO,WAAW,eAAA,EAAgB;AACxF,QAAA,OAAO,IAAA;AAAA,MACT;AAAA,KACF,CAAA;AAAA,EACF,CAAA;AACF","file":"next.cjs","sourcesContent":["/**\n * tailwind-styled-v4 — withTailwindStyled v3\n *\n * Next.js plugin dengan full v3 integration:\n * - Plugin system\n * - DevTools overlay\n * - Static variant compilation\n * - Dead style elimination\n * - Route CSS bundling\n * - React Compiler compat\n * - Idempotency guard\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport type { TwPlugin } from \"@tailwind-styled/plugin\"\nimport type { NextConfig } from \"next\"\n\nexport interface TailwindStyledNextOptions {\n mode?: \"zero-runtime\" | \"runtime\"\n addDataAttr?: boolean\n scanDirs?: string[]\n safelistOutput?: string\n autoClientBoundary?: boolean\n hoist?: boolean\n routeCss?: boolean\n routeCssDir?: string\n atomic?: boolean\n zeroConfig?: boolean\n /** v3: plugins array */\n plugins?: TwPlugin[]\n /** v3: DevTools overlay. Default: true in dev */\n devtools?: boolean\n /** v3: pre-compile all variant combos. Default: true in prod */\n staticVariants?: boolean\n /** v3: remove unused variant CSS at build. Default: true in prod */\n deadStyleElimination?: boolean\n /** v4: incremental CSS compiler — only recompile changed files. Default: true */\n incremental?: boolean\n /** v4: style bucket system — deterministic CSS ordering. Default: true */\n styleBuckets?: boolean\n /** v4: verbose logging untuk incremental engine. Default: false */\n incrementalVerbose?: boolean\n}\n\nconst LOADER_PATH = require.resolve(\"./turbopackLoader\")\nconst WEBPACK_LOADER_PATH = require.resolve(\"./webpackLoader\")\n\nexport function withTailwindStyled(opts: TailwindStyledNextOptions = {}) {\n return (nextConfig: NextConfig = {}): NextConfig => {\n const cwd = process.cwd()\n const isDev = process.env.NODE_ENV !== \"production\"\n\n const hasReactCompiler =\n (nextConfig as any).reactCompiler === true ||\n (nextConfig as any).experimental?.reactCompiler === true\n\n if (hasReactCompiler && isDev) {\n console.log(\"[tailwind-styled-v4] React Compiler detected → hoist disabled\")\n }\n\n const {\n scanDirs = [\"src\"],\n safelistOutput = \"src/app/__tw-safelist.css\",\n autoClientBoundary = true,\n hoist = !hasReactCompiler,\n atomic = false,\n routeCssDir = path.join(cwd, \".next\", \"static\", \"css\", \"tw\"),\n zeroConfig = true,\n plugins = [],\n devtools = isDev,\n staticVariants = !isDev,\n deadStyleElimination = !isDev,\n } = opts\n\n const routeCss = opts.routeCss !== undefined ? opts.routeCss : !isDev\n\n if (zeroConfig) {\n try {\n const { bootstrapZeroConfig } = require(\"@tailwind-styled/compiler\")\n bootstrapZeroConfig(cwd)\n } catch {\n /* non-critical */\n }\n }\n\n // Ensure safelist CSS exists (even empty) so @import in globals.css doesn't fail\n // on first run before generateBuildId has been called.\n const safelistAbsPath = path.isAbsolute(safelistOutput)\n ? safelistOutput\n : path.resolve(cwd, safelistOutput)\n if (!fs.existsSync(safelistAbsPath)) {\n try {\n fs.mkdirSync(path.dirname(safelistAbsPath), { recursive: true })\n fs.writeFileSync(\n safelistAbsPath,\n \"/* Auto-generated by tailwind-styled-v4 — DO NOT EDIT */\\n\"\n )\n } catch {\n /* non-critical */\n }\n }\n\n if (plugins.length > 0) {\n try {\n const { use } = require(\"@tailwind-styled/plugin\")\n for (const plugin of plugins) use(plugin)\n console.log(\n `[tailwind-styled-v4] ${plugins.length} plugin(s): ${plugins.map((p: TwPlugin) => p.name).join(\", \")}`\n )\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Plugin init failed:\", e)\n }\n }\n\n const loaderOpts = {\n mode: opts.mode,\n addDataAttr: opts.addDataAttr ?? isDev,\n autoClientBoundary,\n hoist,\n atomic,\n routeCss,\n staticVariants,\n }\n\n return {\n ...nextConfig,\n\n experimental: {\n ...(nextConfig.experimental as any),\n },\n\n // Next.js 16+: turbopack moved to top-level\n // FIX TURBOPACK: pattern \"*.{tsx,ts,jsx,js}\" terlalu lebar — ikut match\n // node_modules/next/dist/client/*.js.tsx dan trigger \"Missing module type\".\n // Solusi: scope pattern ke scanDirs saja, jangan catch-all.\n // `as` field dihapus — tidak perlu karena loader output tetap TSX-compatible.\n turbopack: {\n ...(nextConfig as any).turbopack,\n rules: {\n ...Object.fromEntries(\n scanDirs.flatMap((dir: string) => [\n [\n `{./${dir},./src,./app,./pages,./components}/**/*.tsx`,\n {\n loaders: [{ loader: LOADER_PATH, options: loaderOpts }],\n },\n ],\n [\n `{./${dir},./src,./app,./pages,./components}/**/*.ts`,\n {\n loaders: [{ loader: LOADER_PATH, options: loaderOpts }],\n },\n ],\n ])\n ),\n ...(nextConfig as any).turbopack?.rules,\n },\n },\n\n webpack(webpackConfig: any, webpackOpts: any) {\n // FIX #08: idempotency\n const alreadyRegistered = webpackConfig.module.rules.some(\n (r: any) => r._tailwindStyledMarker === true\n )\n if (!alreadyRegistered) {\n webpackConfig.module.rules.push({\n _tailwindStyledMarker: true,\n test: /\\.(tsx|ts|jsx|js)$/,\n exclude: /node_modules/,\n use: [\n {\n loader: WEBPACK_LOADER_PATH,\n options: {\n ...loaderOpts,\n mode: opts.mode ?? (webpackOpts.dev ? \"runtime\" : \"zero-runtime\"),\n addDataAttr: opts.addDataAttr ?? webpackOpts.dev,\n },\n },\n ],\n })\n }\n\n if (devtools && webpackOpts.dev) {\n webpackConfig.resolve = webpackConfig.resolve ?? {}\n webpackConfig.resolve.alias = {\n ...(webpackConfig.resolve.alias ?? {}),\n \"tailwind-styled-v4/devtools\": path.resolve(__dirname, \"../../devtools/src/index.tsx\"),\n }\n }\n\n return typeof nextConfig.webpack === \"function\"\n ? nextConfig.webpack(webpackConfig, webpackOpts)\n : webpackConfig\n },\n\n generateBuildId: async () => {\n // 1. Safelist — Tailwind v4: output @source inline() CSS (not JSON)\n try {\n const { generateSafelistCss } = require(\"@tailwind-styled/compiler\")\n generateSafelistCss(\n scanDirs.map((d: string) => path.resolve(cwd, d)),\n path.isAbsolute(safelistOutput) ? safelistOutput : path.resolve(cwd, safelistOutput)\n )\n console.log(\"[tailwind-styled-v4] ✓ Safelist CSS generated\")\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Safelist skipped:\", e)\n }\n\n // 2. Plugin build hooks\n if (plugins.length > 0) {\n try {\n const { getGlobalRegistry, runBuildHooks } = require(\"@tailwind-styled/plugin\")\n await runBuildHooks(getGlobalRegistry())\n console.log(\"[tailwind-styled-v4] ✓ Plugin build hooks complete\")\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Plugin build hooks failed:\", e)\n }\n }\n\n // 3. Route CSS + dead style elimination\n if (routeCss) {\n try {\n const {\n generateAllRouteCss,\n getCollectorSummary,\n runElimination,\n } = require(\"@tailwind-styled/compiler\")\n\n const results = await generateAllRouteCss({ cwd, outputDir: routeCssDir, minify: true })\n console.log(getCollectorSummary())\n\n if (deadStyleElimination) {\n let totalSaved = 0\n for (const result of results) {\n const routeFile = path.join(\n routeCssDir,\n result.route === \"/\" ? \"index.css\" : `${result.route.replace(/\\//g, \"_\")}.css`\n )\n if (fs.existsSync(routeFile)) {\n const inputCss = fs.readFileSync(routeFile, \"utf-8\")\n const { css, report } = runElimination({ dirs: scanDirs, cwd, inputCss })\n fs.writeFileSync(routeFile, css)\n totalSaved += report.bytesSaved\n }\n }\n if (totalSaved > 0) {\n console.log(\n `[tailwind-styled-v4] ✓ Dead styles eliminated: ~${(totalSaved / 1024).toFixed(1)}KB saved`\n )\n }\n }\n\n const totalKb = results.reduce((s: number, r: any) => s + r.sizeBytes, 0) / 1024\n console.log(\n `[tailwind-styled-v4] ✓ Route CSS: ${results.length} routes, ${totalKb.toFixed(1)}KB`\n )\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Route CSS skipped:\", e)\n }\n }\n\n // 4. Plugin CSS\n if (plugins.length > 0) {\n try {\n const {\n getGlobalRegistry,\n generateTokenCss,\n generateUtilityCss,\n applyCssHooks,\n } = require(\"@tailwind-styled/plugin\")\n const registry = getGlobalRegistry()\n let pluginCss = [generateTokenCss(registry), generateUtilityCss(registry)]\n .filter(Boolean)\n .join(\"\\n\\n\")\n pluginCss = applyCssHooks(pluginCss, registry)\n if (pluginCss.trim()) {\n const outPath = path.join(cwd, \"public\", \"__tw-plugins.css\")\n fs.mkdirSync(path.dirname(outPath), { recursive: true })\n fs.writeFileSync(outPath, pluginCss)\n console.log(\"[tailwind-styled-v4] ✓ Plugin CSS → public/__tw-plugins.css\")\n }\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Plugin CSS skipped:\", e)\n }\n }\n\n // 5. Incremental engine + bucket system flush\n const { incremental = true, styleBuckets = true, incrementalVerbose = false } = opts\n if (incremental) {\n try {\n const { getIncrementalEngine, getBucketEngine } = require(\"@tailwind-styled/compiler\")\n\n const engine = getIncrementalEngine({ verbose: incrementalVerbose })\n engine.buildEndSync()\n\n const stats = engine.getStats()\n console.log(\n `[tailwind-styled-v4] ✓ Incremental: ${stats.changedFiles}/${stats.totalFiles} files changed | ` +\n `+${stats.addedRules} -${stats.removedRules} rules | ${stats.buildTimeMs}ms`\n )\n\n if (styleBuckets) {\n const buckets = getBucketEngine()\n const allNodes = engine.getAllNodes()\n for (const node of allNodes) buckets.add(node)\n const css = buckets.emit()\n const outPath = path.join(cwd, \"public\", \"__tw-atomic.css\")\n fs.mkdirSync(path.dirname(outPath), { recursive: true })\n fs.writeFileSync(outPath, css)\n const bStats = buckets.stats()\n console.log(\n `[tailwind-styled-v4] ✓ Bucket CSS → public/__tw-atomic.css | ` +\n `${bStats.totalNodes} rules`\n )\n }\n } catch (e) {\n console.warn(\"[tailwind-styled-v4] Incremental engine flush skipped:\", e)\n }\n }\n\n if (typeof nextConfig.generateBuildId === \"function\") return nextConfig.generateBuildId()\n return null\n },\n }\n }\n}\n\nexport default withTailwindStyled\n"]}
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TwPlugin } from '@tailwind-styled/plugin';
|
|
2
|
+
import { NextConfig } from 'next';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* tailwind-styled-v4 — withTailwindStyled v3
|
|
6
|
+
*
|
|
7
|
+
* Next.js plugin dengan full v3 integration:
|
|
8
|
+
* - Plugin system
|
|
9
|
+
* - DevTools overlay
|
|
10
|
+
* - Static variant compilation
|
|
11
|
+
* - Dead style elimination
|
|
12
|
+
* - Route CSS bundling
|
|
13
|
+
* - React Compiler compat
|
|
14
|
+
* - Idempotency guard
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface TailwindStyledNextOptions {
|
|
18
|
+
mode?: "zero-runtime" | "runtime";
|
|
19
|
+
addDataAttr?: boolean;
|
|
20
|
+
scanDirs?: string[];
|
|
21
|
+
safelistOutput?: string;
|
|
22
|
+
autoClientBoundary?: boolean;
|
|
23
|
+
hoist?: boolean;
|
|
24
|
+
routeCss?: boolean;
|
|
25
|
+
routeCssDir?: string;
|
|
26
|
+
atomic?: boolean;
|
|
27
|
+
zeroConfig?: boolean;
|
|
28
|
+
/** v3: plugins array */
|
|
29
|
+
plugins?: TwPlugin[];
|
|
30
|
+
/** v3: DevTools overlay. Default: true in dev */
|
|
31
|
+
devtools?: boolean;
|
|
32
|
+
/** v3: pre-compile all variant combos. Default: true in prod */
|
|
33
|
+
staticVariants?: boolean;
|
|
34
|
+
/** v3: remove unused variant CSS at build. Default: true in prod */
|
|
35
|
+
deadStyleElimination?: boolean;
|
|
36
|
+
/** v4: incremental CSS compiler — only recompile changed files. Default: true */
|
|
37
|
+
incremental?: boolean;
|
|
38
|
+
/** v4: style bucket system — deterministic CSS ordering. Default: true */
|
|
39
|
+
styleBuckets?: boolean;
|
|
40
|
+
/** v4: verbose logging untuk incremental engine. Default: false */
|
|
41
|
+
incrementalVerbose?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare function withTailwindStyled(opts?: TailwindStyledNextOptions): (nextConfig?: NextConfig) => NextConfig;
|
|
44
|
+
|
|
45
|
+
export { type TailwindStyledNextOptions, withTailwindStyled };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TwPlugin } from '@tailwind-styled/plugin';
|
|
2
|
+
import { NextConfig } from 'next';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* tailwind-styled-v4 — withTailwindStyled v3
|
|
6
|
+
*
|
|
7
|
+
* Next.js plugin dengan full v3 integration:
|
|
8
|
+
* - Plugin system
|
|
9
|
+
* - DevTools overlay
|
|
10
|
+
* - Static variant compilation
|
|
11
|
+
* - Dead style elimination
|
|
12
|
+
* - Route CSS bundling
|
|
13
|
+
* - React Compiler compat
|
|
14
|
+
* - Idempotency guard
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface TailwindStyledNextOptions {
|
|
18
|
+
mode?: "zero-runtime" | "runtime";
|
|
19
|
+
addDataAttr?: boolean;
|
|
20
|
+
scanDirs?: string[];
|
|
21
|
+
safelistOutput?: string;
|
|
22
|
+
autoClientBoundary?: boolean;
|
|
23
|
+
hoist?: boolean;
|
|
24
|
+
routeCss?: boolean;
|
|
25
|
+
routeCssDir?: string;
|
|
26
|
+
atomic?: boolean;
|
|
27
|
+
zeroConfig?: boolean;
|
|
28
|
+
/** v3: plugins array */
|
|
29
|
+
plugins?: TwPlugin[];
|
|
30
|
+
/** v3: DevTools overlay. Default: true in dev */
|
|
31
|
+
devtools?: boolean;
|
|
32
|
+
/** v3: pre-compile all variant combos. Default: true in prod */
|
|
33
|
+
staticVariants?: boolean;
|
|
34
|
+
/** v3: remove unused variant CSS at build. Default: true in prod */
|
|
35
|
+
deadStyleElimination?: boolean;
|
|
36
|
+
/** v4: incremental CSS compiler — only recompile changed files. Default: true */
|
|
37
|
+
incremental?: boolean;
|
|
38
|
+
/** v4: style bucket system — deterministic CSS ordering. Default: true */
|
|
39
|
+
styleBuckets?: boolean;
|
|
40
|
+
/** v4: verbose logging untuk incremental engine. Default: false */
|
|
41
|
+
incrementalVerbose?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare function withTailwindStyled(opts?: TailwindStyledNextOptions): (nextConfig?: NextConfig) => NextConfig;
|
|
44
|
+
|
|
45
|
+
export { type TailwindStyledNextOptions, withTailwindStyled };
|
package/dist/next.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
/* tailwind-styled-v4 v4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
25
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
26
|
+
}) : x)(function(x) {
|
|
27
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
28
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
29
|
+
});
|
|
30
|
+
var LOADER_PATH = __require.resolve("./turbopackLoader");
|
|
31
|
+
var WEBPACK_LOADER_PATH = __require.resolve("./webpackLoader");
|
|
32
|
+
function withTailwindStyled(opts = {}) {
|
|
33
|
+
return (nextConfig = {}) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
const cwd = process.cwd();
|
|
36
|
+
const isDev = process.env.NODE_ENV !== "production";
|
|
37
|
+
const hasReactCompiler = nextConfig.reactCompiler === true || ((_a = nextConfig.experimental) == null ? void 0 : _a.reactCompiler) === true;
|
|
38
|
+
if (hasReactCompiler && isDev) {
|
|
39
|
+
console.log("[tailwind-styled-v4] React Compiler detected \u2192 hoist disabled");
|
|
40
|
+
}
|
|
41
|
+
const {
|
|
42
|
+
scanDirs = ["src"],
|
|
43
|
+
safelistOutput = "src/app/__tw-safelist.css",
|
|
44
|
+
autoClientBoundary = true,
|
|
45
|
+
hoist = !hasReactCompiler,
|
|
46
|
+
atomic = false,
|
|
47
|
+
routeCssDir = path.join(cwd, ".next", "static", "css", "tw"),
|
|
48
|
+
zeroConfig = true,
|
|
49
|
+
plugins = [],
|
|
50
|
+
devtools = isDev,
|
|
51
|
+
staticVariants = !isDev,
|
|
52
|
+
deadStyleElimination = !isDev
|
|
53
|
+
} = opts;
|
|
54
|
+
const routeCss = opts.routeCss !== void 0 ? opts.routeCss : !isDev;
|
|
55
|
+
if (zeroConfig) {
|
|
56
|
+
try {
|
|
57
|
+
const { bootstrapZeroConfig } = __require("@tailwind-styled/compiler");
|
|
58
|
+
bootstrapZeroConfig(cwd);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const safelistAbsPath = path.isAbsolute(safelistOutput) ? safelistOutput : path.resolve(cwd, safelistOutput);
|
|
63
|
+
if (!fs.existsSync(safelistAbsPath)) {
|
|
64
|
+
try {
|
|
65
|
+
fs.mkdirSync(path.dirname(safelistAbsPath), { recursive: true });
|
|
66
|
+
fs.writeFileSync(
|
|
67
|
+
safelistAbsPath,
|
|
68
|
+
"/* Auto-generated by tailwind-styled-v4 \u2014 DO NOT EDIT */\n"
|
|
69
|
+
);
|
|
70
|
+
} catch (e) {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (plugins.length > 0) {
|
|
74
|
+
try {
|
|
75
|
+
const { use } = __require("@tailwind-styled/plugin");
|
|
76
|
+
for (const plugin of plugins) use(plugin);
|
|
77
|
+
console.log(
|
|
78
|
+
`[tailwind-styled-v4] ${plugins.length} plugin(s): ${plugins.map((p) => p.name).join(", ")}`
|
|
79
|
+
);
|
|
80
|
+
} catch (e) {
|
|
81
|
+
console.warn("[tailwind-styled-v4] Plugin init failed:", e);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const loaderOpts = {
|
|
85
|
+
mode: opts.mode,
|
|
86
|
+
addDataAttr: (_b = opts.addDataAttr) != null ? _b : isDev,
|
|
87
|
+
autoClientBoundary,
|
|
88
|
+
hoist,
|
|
89
|
+
atomic,
|
|
90
|
+
routeCss,
|
|
91
|
+
staticVariants
|
|
92
|
+
};
|
|
93
|
+
return __spreadProps(__spreadValues({}, nextConfig), {
|
|
94
|
+
experimental: __spreadValues({}, nextConfig.experimental),
|
|
95
|
+
// Next.js 16+: turbopack moved to top-level
|
|
96
|
+
// FIX TURBOPACK: pattern "*.{tsx,ts,jsx,js}" terlalu lebar — ikut match
|
|
97
|
+
// node_modules/next/dist/client/*.js.tsx dan trigger "Missing module type".
|
|
98
|
+
// Solusi: scope pattern ke scanDirs saja, jangan catch-all.
|
|
99
|
+
// `as` field dihapus — tidak perlu karena loader output tetap TSX-compatible.
|
|
100
|
+
turbopack: __spreadProps(__spreadValues({}, nextConfig.turbopack), {
|
|
101
|
+
rules: __spreadValues(__spreadValues({}, Object.fromEntries(
|
|
102
|
+
scanDirs.flatMap((dir) => [
|
|
103
|
+
[
|
|
104
|
+
`{./${dir},./src,./app,./pages,./components}/**/*.tsx`,
|
|
105
|
+
{
|
|
106
|
+
loaders: [{ loader: LOADER_PATH, options: loaderOpts }]
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
`{./${dir},./src,./app,./pages,./components}/**/*.ts`,
|
|
111
|
+
{
|
|
112
|
+
loaders: [{ loader: LOADER_PATH, options: loaderOpts }]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
])
|
|
116
|
+
)), (_c = nextConfig.turbopack) == null ? void 0 : _c.rules)
|
|
117
|
+
}),
|
|
118
|
+
webpack(webpackConfig, webpackOpts) {
|
|
119
|
+
var _a2, _b2, _c2, _d;
|
|
120
|
+
const alreadyRegistered = webpackConfig.module.rules.some(
|
|
121
|
+
(r) => r._tailwindStyledMarker === true
|
|
122
|
+
);
|
|
123
|
+
if (!alreadyRegistered) {
|
|
124
|
+
webpackConfig.module.rules.push({
|
|
125
|
+
_tailwindStyledMarker: true,
|
|
126
|
+
test: /\.(tsx|ts|jsx|js)$/,
|
|
127
|
+
exclude: /node_modules/,
|
|
128
|
+
use: [
|
|
129
|
+
{
|
|
130
|
+
loader: WEBPACK_LOADER_PATH,
|
|
131
|
+
options: __spreadProps(__spreadValues({}, loaderOpts), {
|
|
132
|
+
mode: (_a2 = opts.mode) != null ? _a2 : webpackOpts.dev ? "runtime" : "zero-runtime",
|
|
133
|
+
addDataAttr: (_b2 = opts.addDataAttr) != null ? _b2 : webpackOpts.dev
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (devtools && webpackOpts.dev) {
|
|
140
|
+
webpackConfig.resolve = (_c2 = webpackConfig.resolve) != null ? _c2 : {};
|
|
141
|
+
webpackConfig.resolve.alias = __spreadProps(__spreadValues({}, (_d = webpackConfig.resolve.alias) != null ? _d : {}), {
|
|
142
|
+
"tailwind-styled-v4/devtools": path.resolve(__dirname, "../../devtools/src/index.tsx")
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return typeof nextConfig.webpack === "function" ? nextConfig.webpack(webpackConfig, webpackOpts) : webpackConfig;
|
|
146
|
+
},
|
|
147
|
+
generateBuildId: async () => {
|
|
148
|
+
try {
|
|
149
|
+
const { generateSafelistCss } = __require("@tailwind-styled/compiler");
|
|
150
|
+
generateSafelistCss(
|
|
151
|
+
scanDirs.map((d) => path.resolve(cwd, d)),
|
|
152
|
+
path.isAbsolute(safelistOutput) ? safelistOutput : path.resolve(cwd, safelistOutput)
|
|
153
|
+
);
|
|
154
|
+
console.log("[tailwind-styled-v4] \u2713 Safelist CSS generated");
|
|
155
|
+
} catch (e) {
|
|
156
|
+
console.warn("[tailwind-styled-v4] Safelist skipped:", e);
|
|
157
|
+
}
|
|
158
|
+
if (plugins.length > 0) {
|
|
159
|
+
try {
|
|
160
|
+
const { getGlobalRegistry, runBuildHooks } = __require("@tailwind-styled/plugin");
|
|
161
|
+
await runBuildHooks(getGlobalRegistry());
|
|
162
|
+
console.log("[tailwind-styled-v4] \u2713 Plugin build hooks complete");
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.warn("[tailwind-styled-v4] Plugin build hooks failed:", e);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (routeCss) {
|
|
168
|
+
try {
|
|
169
|
+
const {
|
|
170
|
+
generateAllRouteCss,
|
|
171
|
+
getCollectorSummary,
|
|
172
|
+
runElimination
|
|
173
|
+
} = __require("@tailwind-styled/compiler");
|
|
174
|
+
const results = await generateAllRouteCss({ cwd, outputDir: routeCssDir, minify: true });
|
|
175
|
+
console.log(getCollectorSummary());
|
|
176
|
+
if (deadStyleElimination) {
|
|
177
|
+
let totalSaved = 0;
|
|
178
|
+
for (const result of results) {
|
|
179
|
+
const routeFile = path.join(
|
|
180
|
+
routeCssDir,
|
|
181
|
+
result.route === "/" ? "index.css" : `${result.route.replace(/\//g, "_")}.css`
|
|
182
|
+
);
|
|
183
|
+
if (fs.existsSync(routeFile)) {
|
|
184
|
+
const inputCss = fs.readFileSync(routeFile, "utf-8");
|
|
185
|
+
const { css, report } = runElimination({ dirs: scanDirs, cwd, inputCss });
|
|
186
|
+
fs.writeFileSync(routeFile, css);
|
|
187
|
+
totalSaved += report.bytesSaved;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (totalSaved > 0) {
|
|
191
|
+
console.log(
|
|
192
|
+
`[tailwind-styled-v4] \u2713 Dead styles eliminated: ~${(totalSaved / 1024).toFixed(1)}KB saved`
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const totalKb = results.reduce((s, r) => s + r.sizeBytes, 0) / 1024;
|
|
197
|
+
console.log(
|
|
198
|
+
`[tailwind-styled-v4] \u2713 Route CSS: ${results.length} routes, ${totalKb.toFixed(1)}KB`
|
|
199
|
+
);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
console.warn("[tailwind-styled-v4] Route CSS skipped:", e);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (plugins.length > 0) {
|
|
205
|
+
try {
|
|
206
|
+
const {
|
|
207
|
+
getGlobalRegistry,
|
|
208
|
+
generateTokenCss,
|
|
209
|
+
generateUtilityCss,
|
|
210
|
+
applyCssHooks
|
|
211
|
+
} = __require("@tailwind-styled/plugin");
|
|
212
|
+
const registry = getGlobalRegistry();
|
|
213
|
+
let pluginCss = [generateTokenCss(registry), generateUtilityCss(registry)].filter(Boolean).join("\n\n");
|
|
214
|
+
pluginCss = applyCssHooks(pluginCss, registry);
|
|
215
|
+
if (pluginCss.trim()) {
|
|
216
|
+
const outPath = path.join(cwd, "public", "__tw-plugins.css");
|
|
217
|
+
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
218
|
+
fs.writeFileSync(outPath, pluginCss);
|
|
219
|
+
console.log("[tailwind-styled-v4] \u2713 Plugin CSS \u2192 public/__tw-plugins.css");
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
console.warn("[tailwind-styled-v4] Plugin CSS skipped:", e);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const { incremental = true, styleBuckets = true, incrementalVerbose = false } = opts;
|
|
226
|
+
if (incremental) {
|
|
227
|
+
try {
|
|
228
|
+
const { getIncrementalEngine, getBucketEngine } = __require("@tailwind-styled/compiler");
|
|
229
|
+
const engine = getIncrementalEngine({ verbose: incrementalVerbose });
|
|
230
|
+
engine.buildEndSync();
|
|
231
|
+
const stats = engine.getStats();
|
|
232
|
+
console.log(
|
|
233
|
+
`[tailwind-styled-v4] \u2713 Incremental: ${stats.changedFiles}/${stats.totalFiles} files changed | +${stats.addedRules} -${stats.removedRules} rules | ${stats.buildTimeMs}ms`
|
|
234
|
+
);
|
|
235
|
+
if (styleBuckets) {
|
|
236
|
+
const buckets = getBucketEngine();
|
|
237
|
+
const allNodes = engine.getAllNodes();
|
|
238
|
+
for (const node of allNodes) buckets.add(node);
|
|
239
|
+
const css = buckets.emit();
|
|
240
|
+
const outPath = path.join(cwd, "public", "__tw-atomic.css");
|
|
241
|
+
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
242
|
+
fs.writeFileSync(outPath, css);
|
|
243
|
+
const bStats = buckets.stats();
|
|
244
|
+
console.log(
|
|
245
|
+
`[tailwind-styled-v4] \u2713 Bucket CSS \u2192 public/__tw-atomic.css | ${bStats.totalNodes} rules`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
} catch (e) {
|
|
249
|
+
console.warn("[tailwind-styled-v4] Incremental engine flush skipped:", e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (typeof nextConfig.generateBuildId === "function") return nextConfig.generateBuildId();
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export { withTailwindStyled };
|
|
260
|
+
//# sourceMappingURL=next.js.map
|
|
261
|
+
//# sourceMappingURL=next.js.map
|