@flairjs/webpack-loader 0.0.2 → 0.1.0-beta.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/cjs/index.js CHANGED
@@ -257,12 +257,12 @@ async function flairJsLoader(source, sourceMap) {
257
257
  const result = transformCode(source, fileName, {
258
258
  appendTimestampToCssFile: false,
259
259
  classNameList: options?.classNameList,
260
- cssPreprocessor: options?.cssPreprocessor ? (css) => options.cssPreprocessor(css, fileName) : void 0,
260
+ cssPreprocessor: options?.cssPreprocessor ? (cssData) => options.cssPreprocessor(cssData, fileName) : void 0,
261
261
  theme: userTheme?.theme,
262
262
  useTheme: !!userTheme,
263
263
  cssOutDir: cssGeneratedDir
264
264
  });
265
- if (!result) return callback(null, source, sourceMap);
265
+ if (!result.success) return callback(null, source, sourceMap);
266
266
  if (!result.generatedCssName) return callback(null, source, sourceMap);
267
267
  this.addDependency(path.resolve(result.generatedCssName));
268
268
  let resultSourcemap = null;
package/dist/esm/index.js CHANGED
@@ -224,12 +224,12 @@ async function flairJsLoader(source, sourceMap) {
224
224
  const result = transformCode$1(source, fileName, {
225
225
  appendTimestampToCssFile: false,
226
226
  classNameList: options?.classNameList,
227
- cssPreprocessor: options?.cssPreprocessor ? (css) => options.cssPreprocessor(css, fileName) : void 0,
227
+ cssPreprocessor: options?.cssPreprocessor ? (cssData) => options.cssPreprocessor(cssData, fileName) : void 0,
228
228
  theme: userTheme?.theme,
229
229
  useTheme: !!userTheme,
230
230
  cssOutDir: cssGeneratedDir
231
231
  });
232
- if (!result) return callback(null, source, sourceMap);
232
+ if (!result.success) return callback(null, source, sourceMap);
233
233
  if (!result.generatedCssName) return callback(null, source, sourceMap);
234
234
  this.addDependency(path$2.resolve(result.generatedCssName));
235
235
  let resultSourcemap = null;
@@ -1,3 +1,4 @@
1
+ import { CssData } from '@flairjs/core';
1
2
  import { FlairThemeConfig } from '@flairjs/client';
2
3
  import { LoaderContext } from 'webpack';
3
4
 
@@ -15,7 +16,7 @@ declare interface SharedPluginOptions {
15
16
  * @param id the id of the file being processed
16
17
  * @returns the processed css
17
18
  */
18
- cssPreprocessor?: (css: string, id: string) => string;
19
+ cssPreprocessor?: (cssData: CssData, id: string) => string;
19
20
  include?: string | string[];
20
21
  exclude?: string | string[];
21
22
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flairjs/webpack-loader",
3
- "version": "0.0.2",
3
+ "version": "0.1.0-beta.0",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -22,12 +22,12 @@
22
22
  "rolldown": "1.0.0-beta.37",
23
23
  "typescript": "^5.8.2",
24
24
  "webpack": "^5.101.0",
25
- "@flairjs/bundler-shared": "0.0.2"
25
+ "@flairjs/bundler-shared": "1.0.0-beta.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "esbuild": "^0.25.10",
29
29
  "picomatch": "^4.0.3",
30
- "@flairjs/core": "0.0.2"
30
+ "@flairjs/core": "0.1.0-beta.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "rimraf dist && tsc && api-extractor run --local && rolldown -c && rimraf dist/types-temp",