unplugin-raw 0.6.4 → 0.7.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/README.md CHANGED
@@ -100,8 +100,7 @@ import text from './js.js?raw'
100
100
  import text2 from './jsx.jsx?raw'
101
101
  import bytes from './png.png?bytes'
102
102
  import text3 from './ts.ts?raw'
103
-
104
- // Import attributes (Rolldown doesn't support this syntax)
103
+ // Import attributes (Rolldown and Vite 8+ doesn't support this syntax)
105
104
  import text4 from './with.js' with { type: 'text' }
106
105
  import bytes2 from './with.png' with { type: 'bytes' }
107
106
  ```
package/dist/api.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { i as resolveOptions, n as OptionsResolved, r as TransformOptions, t as Options } from "./options-DSAzFv_P.mjs";
2
- import * as esbuild0 from "esbuild";
1
+ import { i as resolveOptions, n as OptionsResolved, r as TransformOptions, t as Options } from "./options-C2J_Ngzl.mjs";
2
+ import * as _$esbuild from "esbuild";
3
3
  import { TransformOptions as TransformOptions$1 } from "esbuild";
4
4
  import { Buffer } from "node:buffer";
5
5
 
6
6
  //#region src/core/transform.d.ts
7
- declare function transformRaw(file: string, type: "text" | "bytes", transform?: typeof esbuild0.transform, transformFilter?: (id: string | unknown) => boolean, options?: TransformOptions$1): Promise<string | Buffer>;
7
+ declare function transformRaw(file: string, type: "text" | "bytes", transform?: typeof _$esbuild.transform, transformFilter?: (id: string | unknown) => boolean, options?: TransformOptions$1): Promise<string | Buffer>;
8
8
  //#endregion
9
9
  export { type Options, type OptionsResolved, type TransformOptions, resolveOptions, transformRaw };
package/dist/api.mjs CHANGED
@@ -1,3 +1,2 @@
1
- import { n as resolveOptions, t as transformRaw } from "./transform-DF3vB7QY.mjs";
2
-
3
- export { resolveOptions, transformRaw };
1
+ import { n as resolveOptions, t as transformRaw } from "./transform-DF-Ud2tE.mjs";
2
+ export { resolveOptions, transformRaw };
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/esbuild.d.ts
5
-
6
4
  /**
7
5
  * Esbuild plugin
8
6
  *
package/dist/esbuild.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/esbuild.ts
5
3
  /**
6
4
  * This entry file is for esbuild plugin. Requires esbuild >= 0.15
@@ -20,8 +18,6 @@ import src_default from "./index.mjs";
20
18
  * })
21
19
  * ```
22
20
  */
23
- const esbuild = src_default.esbuild;
24
- var esbuild_default = esbuild;
25
-
21
+ const esbuild = unplugin.esbuild;
26
22
  //#endregion
27
- export { esbuild_default as default, esbuild as "module.exports" };
23
+ export { esbuild as default, esbuild as "module.exports" };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Options } from "./options-DSAzFv_P.mjs";
1
+ import { t as Options } from "./options-C2J_Ngzl.mjs";
2
2
  import { UnpluginInstance } from "unplugin";
3
3
 
4
4
  //#region src/index.d.ts
package/dist/index.mjs CHANGED
@@ -1,7 +1,6 @@
1
- import { n as resolveOptions, t as transformRaw } from "./transform-DF3vB7QY.mjs";
1
+ import { n as resolveOptions, t as transformRaw } from "./transform-DF-Ud2tE.mjs";
2
2
  import { createUnplugin } from "unplugin";
3
3
  import { createFilter } from "unplugin-utils";
4
-
5
4
  //#region src/index.ts
6
5
  const rawRE = /[&?]raw(?:&|$)/;
7
6
  const bytesRE = /[&?]bytes(?:&|$)/;
@@ -19,8 +18,8 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
19
18
  "rollup",
20
19
  "rolldown",
21
20
  "vite"
22
- ].includes(meta.framework) ? async function(id, importer, options$1) {
23
- const attributeType = options$1?.attributes?.type;
21
+ ].includes(meta.framework) ? async function(id, importer, options) {
22
+ const attributeType = options?.attributes?.type;
24
23
  if (attributeType === "text") id += `${id.includes("?") ? "&" : "?"}raw`;
25
24
  else if (attributeType === "bytes") id += `${id.includes("?") ? "&" : "?"}bytes`;
26
25
  else if (!rawRE.test(id) && !bytesRE.test(id)) return;
@@ -54,7 +53,5 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
54
53
  } }
55
54
  };
56
55
  });
57
- var src_default = unplugin;
58
-
59
56
  //#endregion
60
- export { src_default as default };
57
+ export { unplugin as default };
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/rolldown.d.ts
5
-
6
4
  /**
7
5
  * Rolldown plugin
8
6
  *
package/dist/rolldown.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/rolldown.ts
5
3
  /**
6
4
  * This entry file is for Rolldown plugin.
@@ -20,8 +18,6 @@ import src_default from "./index.mjs";
20
18
  * }
21
19
  * ```
22
20
  */
23
- const rolldown = src_default.rolldown;
24
- var rolldown_default = rolldown;
25
-
21
+ const rolldown = unplugin.rolldown;
26
22
  //#endregion
27
- export { rolldown_default as default, rolldown as "module.exports" };
23
+ export { rolldown as default, rolldown as "module.exports" };
package/dist/rollup.d.mts CHANGED
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/rollup.d.ts
5
-
6
4
  /**
7
5
  * Rollup plugin
8
6
  *
package/dist/rollup.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/rollup.ts
5
3
  /**
6
4
  * This entry file is for Rollup plugin.
@@ -20,8 +18,6 @@ import src_default from "./index.mjs";
20
18
  * }
21
19
  * ```
22
20
  */
23
- const rollup = src_default.rollup;
24
- var rollup_default = rollup;
25
-
21
+ const rollup = unplugin.rollup;
26
22
  //#endregion
27
- export { rollup_default as default, rollup as "module.exports" };
23
+ export { rollup as default, rollup as "module.exports" };
package/dist/rspack.d.mts CHANGED
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/rspack.d.ts
5
-
6
4
  /**
7
5
  * Rspack plugin
8
6
  *
package/dist/rspack.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/rspack.ts
5
3
  /**
6
4
  * This entry file is for rspack plugin.
@@ -18,8 +16,6 @@ import src_default from "./index.mjs";
18
16
  * }
19
17
  * ```
20
18
  */
21
- const rspack = src_default.rspack;
22
- var rspack_default = rspack;
23
-
19
+ const rspack = unplugin.rspack;
24
20
  //#endregion
25
- export { rspack_default as default, rspack as "module.exports" };
21
+ export { rspack as default, rspack as "module.exports" };
@@ -1,6 +1,5 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
-
4
3
  //#region src/core/options.ts
5
4
  function resolveOptions(options) {
6
5
  let { transform = false } = options;
@@ -16,7 +15,6 @@ function resolveOptions(options) {
16
15
  } : false
17
16
  };
18
17
  }
19
-
20
18
  //#endregion
21
19
  //#region src/core/transform.ts
22
20
  async function transformRaw(file, type, transform, transformFilter, options) {
@@ -50,6 +48,5 @@ const ExtToLoader = {
50
48
  function guessLoader(id) {
51
49
  return ExtToLoader[path.extname(id).toLowerCase()] || "js";
52
50
  }
53
-
54
51
  //#endregion
55
- export { resolveOptions as n, transformRaw as t };
52
+ export { resolveOptions as n, transformRaw as t };
package/dist/vite.d.mts CHANGED
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/vite.d.ts
5
-
6
4
  /**
7
5
  * Vite plugin
8
6
  *
package/dist/vite.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/vite.ts
5
3
  /**
6
4
  * This entry file is for Vite plugin.
@@ -20,8 +18,6 @@ import src_default from "./index.mjs";
20
18
  * })
21
19
  * ```
22
20
  */
23
- const vite = src_default.vite;
24
- var vite_default = vite;
25
-
21
+ const vite = unplugin.vite;
26
22
  //#endregion
27
- export { vite_default as default, vite as "module.exports" };
23
+ export { vite as default, vite as "module.exports" };
@@ -1,8 +1,6 @@
1
- import "./options-DSAzFv_P.mjs";
2
1
  import unplugin from "./index.mjs";
3
2
 
4
3
  //#region src/webpack.d.ts
5
-
6
4
  /**
7
5
  * Webpack plugin
8
6
  *
package/dist/webpack.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import "./transform-DF3vB7QY.mjs";
2
- import src_default from "./index.mjs";
3
-
1
+ import unplugin from "./index.mjs";
4
2
  //#region src/webpack.ts
5
3
  /**
6
4
  * This entry file is for webpack plugin.
@@ -18,8 +16,6 @@ import src_default from "./index.mjs";
18
16
  * }
19
17
  * ```
20
18
  */
21
- const webpack = src_default.webpack;
22
- var webpack_default = webpack;
23
-
19
+ const webpack = unplugin.webpack;
24
20
  //#endregion
25
- export { webpack_default as default, webpack as "module.exports" };
21
+ export { webpack as default, webpack as "module.exports" };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-raw",
3
3
  "type": "module",
4
- "version": "0.6.4",
4
+ "version": "0.7.0",
5
5
  "description": "Transform file to a default-export string.",
6
6
  "author": "Kevin Deng <sxzz@sxzz.moe>",
7
7
  "license": "MIT",
@@ -32,15 +32,6 @@
32
32
  "./webpack": "./dist/webpack.mjs",
33
33
  "./package.json": "./package.json"
34
34
  },
35
- "types": "./dist/index.d.mts",
36
- "typesVersions": {
37
- "*": {
38
- "*": [
39
- "./dist/*.d.mts",
40
- "./*"
41
- ]
42
- }
43
- },
44
35
  "files": [
45
36
  "dist"
46
37
  ],
@@ -59,24 +50,25 @@
59
50
  }
60
51
  },
61
52
  "dependencies": {
62
- "unplugin": "^2.3.11",
53
+ "unplugin": "^3.0.0",
63
54
  "unplugin-utils": "^0.3.1"
64
55
  },
65
56
  "devDependencies": {
66
- "@sxzz/eslint-config": "^7.4.4",
67
- "@sxzz/prettier-config": "^2.2.6",
68
- "@types/node": "^25.0.3",
69
- "bumpp": "^10.3.2",
70
- "esbuild": "^0.27.2",
71
- "eslint": "^9.39.2",
72
- "prettier": "^3.7.4",
73
- "rolldown": "^1.0.0-beta.58",
74
- "rollup": "^4.54.0",
75
- "tsdown": "^0.19.0-beta.2",
76
- "tsdown-preset-sxzz": "^0.2.0",
77
- "typescript": "^5.9.3",
78
- "vite": "^7.3.0",
79
- "vitest": "^4.0.16"
57
+ "@sxzz/eslint-config": "^7.8.4",
58
+ "@sxzz/prettier-config": "^2.3.1",
59
+ "@types/node": "^25.5.0",
60
+ "@typescript/native-preview": "7.0.0-dev.20260328.1",
61
+ "bumpp": "^11.0.1",
62
+ "esbuild": "^0.27.4",
63
+ "eslint": "^10.1.0",
64
+ "prettier": "^3.8.1",
65
+ "rolldown": "^1.0.0-rc.12",
66
+ "rollup": "^4.60.0",
67
+ "tsdown": "^0.21.7",
68
+ "tsdown-preset-sxzz": "^0.5.0",
69
+ "typescript": "^6.0.2",
70
+ "vite": "^8.0.3",
71
+ "vitest": "^4.1.2"
80
72
  },
81
73
  "prettier": "@sxzz/prettier-config",
82
74
  "scripts": {
@@ -85,7 +77,7 @@
85
77
  "build": "tsdown",
86
78
  "dev": "tsdown --watch",
87
79
  "test": "vitest",
88
- "typecheck": "tsc --noEmit",
80
+ "typecheck": "tsgo --noEmit",
89
81
  "release": "bumpp"
90
82
  }
91
83
  }