@flairjs/webpack-loader 0.0.1-beta.2 → 0.0.1-beta.5
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/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/index.js +7 -13
- package/package.json +13 -6
package/dist/cjs/index.js
CHANGED
|
@@ -212,7 +212,7 @@ async function flairJsLoader(source, sourceMap) {
|
|
|
212
212
|
});
|
|
213
213
|
if (!result) return callback(null, source, sourceMap);
|
|
214
214
|
if (result.generatedCssName) context.refreshCssFile(result.generatedCssName);
|
|
215
|
-
callback(null, result.code, result.
|
|
215
|
+
callback(null, result.code, result.map ? JSON.parse(result.map ?? "{}") : sourceMap);
|
|
216
216
|
} catch (error) {
|
|
217
217
|
console.error("[@flairjs/webpack-loader]", error);
|
|
218
218
|
callback(error, source, sourceMap);
|
package/dist/esm/index.js
CHANGED
|
@@ -178,7 +178,7 @@ async function flairJsLoader(source, sourceMap) {
|
|
|
178
178
|
});
|
|
179
179
|
if (!result) return callback(null, source, sourceMap);
|
|
180
180
|
if (result.generatedCssName) context.refreshCssFile(result.generatedCssName);
|
|
181
|
-
callback(null, result.code, result.
|
|
181
|
+
callback(null, result.code, result.map ? JSON.parse(result.map ?? "{}") : sourceMap);
|
|
182
182
|
} catch (error) {
|
|
183
183
|
console.error("[@flairjs/webpack-loader]", error);
|
|
184
184
|
callback(error, source, sourceMap);
|
package/dist/types/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { existsSync as existsSync$1 } from "fs";
|
|
|
6
6
|
import path$1 from "path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { pathToFileURL } from "url";
|
|
9
|
+
import { transformCode } from "@flairjs/core";
|
|
9
10
|
|
|
10
11
|
//#region rolldown:runtime
|
|
11
12
|
var __create = Object.create;
|
|
@@ -27,7 +28,6 @@ var __copyProps$1 = (to, from, except, desc) => {
|
|
|
27
28
|
}
|
|
28
29
|
return to;
|
|
29
30
|
};
|
|
30
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps$1(target, mod, "default"), secondTarget && __copyProps$1(secondTarget, mod, "default"));
|
|
31
31
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
32
32
|
value: mod,
|
|
33
33
|
enumerable: true
|
|
@@ -3946,16 +3946,10 @@ var require_picomatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/p
|
|
|
3946
3946
|
module.exports = picomatch$1;
|
|
3947
3947
|
}) });
|
|
3948
3948
|
|
|
3949
|
-
//#endregion
|
|
3950
|
-
//#region ../core/browser.js
|
|
3951
|
-
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
3952
|
-
var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
3953
|
-
var browser_exports = {};
|
|
3954
|
-
import * as import___flairjs_core_wasm32_wasi from "@flairjs/core-wasm32-wasi";
|
|
3955
|
-
__reExport(browser_exports, import___flairjs_core_wasm32_wasi);
|
|
3956
|
-
|
|
3957
3949
|
//#endregion
|
|
3958
3950
|
//#region ../shared/dist/esm/index.js
|
|
3951
|
+
var import_main = /* @__PURE__ */ __toESM(require_main(), 1);
|
|
3952
|
+
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
3959
3953
|
String.raw;
|
|
3960
3954
|
const buildThemeTokens = (theme, themeName) => {
|
|
3961
3955
|
let css$1 = "";
|
|
@@ -4086,8 +4080,8 @@ const logger = {
|
|
|
4086
4080
|
console.log(`${colors.bg.blue}${colors.fg.white}[flairjs/Info]${colors.reset} ${msg}${colors.reset}`);
|
|
4087
4081
|
}
|
|
4088
4082
|
};
|
|
4089
|
-
const transformCode = (code, filePath, options) => {
|
|
4090
|
-
const result =
|
|
4083
|
+
const transformCode$1 = (code, filePath, options) => {
|
|
4084
|
+
const result = transformCode(code, filePath, {
|
|
4091
4085
|
cssOutDir: options.cssOutDir,
|
|
4092
4086
|
classNameList: options.classNameList,
|
|
4093
4087
|
useTheme: options.useTheme,
|
|
@@ -4121,7 +4115,7 @@ function flairJsLoader(source, sourceMap) {
|
|
|
4121
4115
|
fileName = this.resourcePath;
|
|
4122
4116
|
if (!shouldProcessFile(fileName, options === null || options === void 0 ? void 0 : options.include, options === null || options === void 0 ? void 0 : options.exclude)) return [2, callback(null, source, sourceMap)];
|
|
4123
4117
|
try {
|
|
4124
|
-
result = transformCode(source, fileName, {
|
|
4118
|
+
result = transformCode$1(source, fileName, {
|
|
4125
4119
|
appendTimestampToCssFile: true,
|
|
4126
4120
|
classNameList: options === null || options === void 0 ? void 0 : options.classNameList,
|
|
4127
4121
|
cssPreprocessor: (options === null || options === void 0 ? void 0 : options.cssPreprocessor) ? function(css) {
|
|
@@ -4133,7 +4127,7 @@ function flairJsLoader(source, sourceMap) {
|
|
|
4133
4127
|
});
|
|
4134
4128
|
if (!result) return [2, callback(null, source, sourceMap)];
|
|
4135
4129
|
if (result.generatedCssName) context$1.refreshCssFile(result.generatedCssName);
|
|
4136
|
-
callback(null, result.code, result.
|
|
4130
|
+
callback(null, result.code, result.map ? JSON.parse((_b = result.map) !== null && _b !== void 0 ? _b : "{}") : sourceMap);
|
|
4137
4131
|
} catch (error) {
|
|
4138
4132
|
console.error("[@flairjs/webpack-loader]", error);
|
|
4139
4133
|
callback(error, source, sourceMap);
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flairjs/webpack-loader",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"import": "./dist/esm/index.js",
|
|
9
|
+
"require": "./dist/cjs/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./cached-css/*": {
|
|
12
|
+
"import": "./dist/.cache/*"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
4
15
|
"main": "./dist/cjs/index.js",
|
|
5
16
|
"module": "./dist/esm/index.js",
|
|
6
17
|
"types": "./dist/types/index.d.ts",
|
|
@@ -22,13 +33,9 @@
|
|
|
22
33
|
"rolldown": "1.0.0-beta.37",
|
|
23
34
|
"typescript": "^5.8.2",
|
|
24
35
|
"webpack": "^5.101.0",
|
|
25
|
-
"@flairjs/bundler-shared": "0.0.1-beta.
|
|
36
|
+
"@flairjs/bundler-shared": "0.0.1-beta.4",
|
|
26
37
|
"@flairjs/core": "0.0.1-beta.4"
|
|
27
38
|
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"esbuild": "^0.25.10",
|
|
30
|
-
"picomatch": "^4.0.3"
|
|
31
|
-
},
|
|
32
39
|
"scripts": {
|
|
33
40
|
"build": "rolldown -c",
|
|
34
41
|
"check": "biome check --write",
|