unplugin-raw 0.6.3 → 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 +1 -2
- package/dist/api.d.mts +9 -0
- package/dist/api.mjs +2 -0
- package/dist/{esbuild.d.ts → esbuild.d.mts} +1 -3
- package/dist/esbuild.mjs +23 -0
- package/dist/{index-BMXQlGcW.d.ts → index.d.mts} +2 -2
- package/dist/{src-CKGRYIxm.js → index.mjs} +9 -14
- package/dist/{options-DupdgTT1.d.ts → options-C2J_Ngzl.d.mts} +1 -1
- package/dist/{rolldown.d.ts → rolldown.d.mts} +1 -3
- package/dist/rolldown.mjs +23 -0
- package/dist/{rollup.d.ts → rollup.d.mts} +1 -3
- package/dist/rollup.mjs +23 -0
- package/dist/{rspack.d.ts → rspack.d.mts} +1 -3
- package/dist/rspack.mjs +21 -0
- package/dist/{options-BTT0I76V.js → transform-DF-Ud2tE.mjs} +21 -24
- package/dist/{vite.d.ts → vite.d.mts} +1 -3
- package/dist/{vite.js → vite.mjs} +8 -7
- package/dist/{webpack.d.ts → webpack.d.mts} +1 -3
- package/dist/webpack.mjs +21 -0
- package/package.json +44 -53
- package/dist/api.d.ts +0 -9
- package/dist/api.js +0 -3
- package/dist/esbuild.js +0 -22
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -4
- package/dist/rolldown.js +0 -22
- package/dist/rollup.js +0 -22
- package/dist/rspack.js +0 -20
- package/dist/webpack.js +0 -20
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
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
import { TransformOptions as TransformOptions$1 } from "esbuild";
|
|
4
|
+
import { Buffer } from "node:buffer";
|
|
5
|
+
|
|
6
|
+
//#region src/core/transform.d.ts
|
|
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
|
+
//#endregion
|
|
9
|
+
export { type Options, type OptionsResolved, type TransformOptions, resolveOptions, transformRaw };
|
package/dist/api.mjs
ADDED
package/dist/esbuild.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
2
|
+
//#region src/esbuild.ts
|
|
3
|
+
/**
|
|
4
|
+
* This entry file is for esbuild plugin. Requires esbuild >= 0.15
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Esbuild plugin
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // esbuild.config.js
|
|
14
|
+
* import { build } from 'esbuild'
|
|
15
|
+
*
|
|
16
|
+
* build({
|
|
17
|
+
* plugins: [require('unplugin-raw/esbuild')()],
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const esbuild = unplugin.esbuild;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { esbuild as default, esbuild as "module.exports" };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Options } from "./options-
|
|
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
|
|
5
5
|
declare const unplugin: UnpluginInstance<Options | undefined, false>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { unplugin };
|
|
7
|
+
export { unplugin as default };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { resolveOptions, transformRaw } from "./
|
|
2
|
-
import { Buffer } from "node:buffer";
|
|
1
|
+
import { n as resolveOptions, t as transformRaw } from "./transform-DF-Ud2tE.mjs";
|
|
3
2
|
import { createUnplugin } from "unplugin";
|
|
4
3
|
import { createFilter } from "unplugin-utils";
|
|
5
|
-
|
|
6
4
|
//#region src/index.ts
|
|
7
5
|
const rawRE = /[&?]raw(?:&|$)/;
|
|
8
6
|
const bytesRE = /[&?]bytes(?:&|$)/;
|
|
@@ -20,8 +18,8 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
20
18
|
"rollup",
|
|
21
19
|
"rolldown",
|
|
22
20
|
"vite"
|
|
23
|
-
].includes(meta.framework) ? async function(id, importer, options
|
|
24
|
-
const attributeType = options
|
|
21
|
+
].includes(meta.framework) ? async function(id, importer, options) {
|
|
22
|
+
const attributeType = options?.attributes?.type;
|
|
25
23
|
if (attributeType === "text") id += `${id.includes("?") ? "&" : "?"}raw`;
|
|
26
24
|
else if (attributeType === "bytes") id += `${id.includes("?") ? "&" : "?"}bytes`;
|
|
27
25
|
else if (!rawRE.test(id) && !bytesRE.test(id)) return;
|
|
@@ -33,20 +31,19 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
33
31
|
load: {
|
|
34
32
|
filter: { id: { include: [rawRE, bytesRE] } },
|
|
35
33
|
async handler(id) {
|
|
36
|
-
const isBytes = bytesRE.test(id);
|
|
37
34
|
const file = cleanUrl(id);
|
|
38
35
|
const context = this.getNativeBuildContext?.();
|
|
39
36
|
const transform = context?.framework === "esbuild" ? context.build.esbuild.transform : void 0;
|
|
40
|
-
let contents = await transformRaw(file,
|
|
41
|
-
if (
|
|
37
|
+
let contents = await transformRaw(file, bytesRE.test(id) ? "bytes" : "text", transform, transformFilter, options.transform ? options.transform.options : void 0);
|
|
38
|
+
if (typeof contents !== "string") contents = `export default new Uint8Array([${contents.join(", ")}])`;
|
|
42
39
|
return contents;
|
|
43
40
|
}
|
|
44
41
|
},
|
|
45
42
|
esbuild: { setup(build) {
|
|
46
43
|
build.onLoad({ filter: /.*/ }, async (args) => {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
const contents = await transformRaw(args.path,
|
|
44
|
+
const type = args.with.type;
|
|
45
|
+
if (type === "text" || type === "bytes") {
|
|
46
|
+
const contents = await transformRaw(args.path, type, build.esbuild.transform, transformFilter, options.transform ? options.transform.options : void 0);
|
|
50
47
|
return {
|
|
51
48
|
contents,
|
|
52
49
|
loader: typeof contents === "string" ? "js" : "binary"
|
|
@@ -56,7 +53,5 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
|
|
|
56
53
|
} }
|
|
57
54
|
};
|
|
58
55
|
});
|
|
59
|
-
var src_default = unplugin;
|
|
60
|
-
|
|
61
56
|
//#endregion
|
|
62
|
-
export {
|
|
57
|
+
export { unplugin as default };
|
|
@@ -24,4 +24,4 @@ type OptionsResolved = Pick<Options, "enforce"> & {
|
|
|
24
24
|
};
|
|
25
25
|
declare function resolveOptions(options: Options): OptionsResolved;
|
|
26
26
|
//#endregion
|
|
27
|
-
export {
|
|
27
|
+
export { resolveOptions as i, OptionsResolved as n, TransformOptions$1 as r, Options as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
2
|
+
//#region src/rolldown.ts
|
|
3
|
+
/**
|
|
4
|
+
* This entry file is for Rolldown plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Rolldown plugin
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // rolldown.config.js
|
|
14
|
+
* import Raw from 'unplugin-raw/rolldown'
|
|
15
|
+
*
|
|
16
|
+
* export default {
|
|
17
|
+
* plugins: [Raw()],
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const rolldown = unplugin.rolldown;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { rolldown as default, rolldown as "module.exports" };
|
package/dist/rollup.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
2
|
+
//#region src/rollup.ts
|
|
3
|
+
/**
|
|
4
|
+
* This entry file is for Rollup plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Rollup plugin
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // rollup.config.js
|
|
14
|
+
* import Raw from 'unplugin-raw/rollup'
|
|
15
|
+
*
|
|
16
|
+
* export default {
|
|
17
|
+
* plugins: [Raw()],
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
const rollup = unplugin.rollup;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { rollup as default, rollup as "module.exports" };
|
package/dist/rspack.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
2
|
+
//#region src/rspack.ts
|
|
3
|
+
/**
|
|
4
|
+
* This entry file is for rspack plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Rspack plugin
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // rspack.config.js
|
|
14
|
+
* module.exports = {
|
|
15
|
+
* plugins: [require('unplugin-raw/rspack')()],
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const rspack = unplugin.rspack;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { rspack as default, rspack as "module.exports" };
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
3
|
+
//#region src/core/options.ts
|
|
4
|
+
function resolveOptions(options) {
|
|
5
|
+
let { transform = false } = options;
|
|
6
|
+
if (transform === true) transform = {};
|
|
7
|
+
return {
|
|
8
|
+
...options,
|
|
9
|
+
enforce: "enforce" in options ? options.enforce : "pre",
|
|
10
|
+
transform: transform ? {
|
|
11
|
+
...transform,
|
|
12
|
+
include: transform.include || [/\.[cm]?[jt]sx?$/],
|
|
13
|
+
exclude: transform.exclude || [/node_modules/],
|
|
14
|
+
options: transform.options || {}
|
|
15
|
+
} : false
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
4
19
|
//#region src/core/transform.ts
|
|
5
|
-
async function transformRaw(file,
|
|
6
|
-
let contents = await readFile(file,
|
|
7
|
-
if (
|
|
20
|
+
async function transformRaw(file, type, transform, transformFilter, options) {
|
|
21
|
+
let contents = await readFile(file, type === "text" ? "utf8" : void 0);
|
|
22
|
+
if (type === "text" && transformFilter?.(file)) {
|
|
8
23
|
transform ||= (await import("esbuild")).transform;
|
|
9
24
|
contents = (await transform(contents, {
|
|
10
25
|
loader: guessLoader(file),
|
|
11
26
|
...options
|
|
12
27
|
})).code;
|
|
13
28
|
}
|
|
14
|
-
return
|
|
29
|
+
return type === "bytes" ? contents : `export default ${JSON.stringify(contents)}`;
|
|
15
30
|
}
|
|
16
31
|
const ExtToLoader = {
|
|
17
32
|
".js": "js",
|
|
@@ -33,23 +48,5 @@ const ExtToLoader = {
|
|
|
33
48
|
function guessLoader(id) {
|
|
34
49
|
return ExtToLoader[path.extname(id).toLowerCase()] || "js";
|
|
35
50
|
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/core/options.ts
|
|
39
|
-
function resolveOptions(options) {
|
|
40
|
-
let { transform = false } = options;
|
|
41
|
-
if (transform === true) transform = {};
|
|
42
|
-
return {
|
|
43
|
-
...options,
|
|
44
|
-
enforce: "enforce" in options ? options.enforce : "pre",
|
|
45
|
-
transform: transform ? {
|
|
46
|
-
...transform,
|
|
47
|
-
include: transform.include || [/\.[cm]?[jt]sx?$/],
|
|
48
|
-
exclude: transform.exclude || [/node_modules/],
|
|
49
|
-
options: transform.options || {}
|
|
50
|
-
} : false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
51
|
//#endregion
|
|
55
|
-
export { resolveOptions, transformRaw };
|
|
52
|
+
export { resolveOptions as n, transformRaw as t };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
4
2
|
//#region src/vite.ts
|
|
5
3
|
/**
|
|
4
|
+
* This entry file is for Vite plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
6
9
|
* Vite plugin
|
|
7
10
|
*
|
|
8
11
|
* @example
|
|
@@ -15,8 +18,6 @@ import { src_default } from "./src-CKGRYIxm.js";
|
|
|
15
18
|
* })
|
|
16
19
|
* ```
|
|
17
20
|
*/
|
|
18
|
-
const vite =
|
|
19
|
-
var vite_default = vite;
|
|
20
|
-
|
|
21
|
+
const vite = unplugin.vite;
|
|
21
22
|
//#endregion
|
|
22
|
-
export {
|
|
23
|
+
export { vite as default, vite as "module.exports" };
|
package/dist/webpack.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import unplugin from "./index.mjs";
|
|
2
|
+
//#region src/webpack.ts
|
|
3
|
+
/**
|
|
4
|
+
* This entry file is for webpack plugin.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Webpack plugin
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // webpack.config.js
|
|
14
|
+
* module.exports = {
|
|
15
|
+
* plugins: [require('unplugin-raw/webpack')()],
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const webpack = unplugin.webpack;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { webpack as default, webpack as "module.exports" };
|
package/package.json
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-raw",
|
|
3
|
-
"version": "0.6.3",
|
|
4
|
-
"description": "Transform file to a default-export string.",
|
|
5
3
|
"type": "module",
|
|
4
|
+
"version": "0.7.0",
|
|
5
|
+
"description": "Transform file to a default-export string.",
|
|
6
|
+
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"funding": "https://github.com/sponsors/sxzz",
|
|
9
|
+
"homepage": "https://github.com/unplugin/unplugin-raw#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/unplugin/unplugin-raw.git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/unplugin/unplugin-raw/issues"
|
|
16
|
+
},
|
|
6
17
|
"keywords": [
|
|
7
18
|
"unplugin",
|
|
8
19
|
"rollup",
|
|
@@ -10,45 +21,26 @@
|
|
|
10
21
|
"esbuild",
|
|
11
22
|
"webpack"
|
|
12
23
|
],
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
24
|
+
"exports": {
|
|
25
|
+
".": "./dist/index.mjs",
|
|
26
|
+
"./api": "./dist/api.mjs",
|
|
27
|
+
"./esbuild": "./dist/esbuild.mjs",
|
|
28
|
+
"./rolldown": "./dist/rolldown.mjs",
|
|
29
|
+
"./rollup": "./dist/rollup.mjs",
|
|
30
|
+
"./rspack": "./dist/rspack.mjs",
|
|
31
|
+
"./vite": "./dist/vite.mjs",
|
|
32
|
+
"./webpack": "./dist/webpack.mjs",
|
|
33
|
+
"./package.json": "./package.json"
|
|
21
34
|
},
|
|
22
|
-
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
23
|
-
"funding": "https://github.com/sponsors/sxzz",
|
|
24
35
|
"files": [
|
|
25
36
|
"dist"
|
|
26
37
|
],
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"module": "./dist/index.js",
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"exports": {
|
|
31
|
-
".": "./dist/index.js",
|
|
32
|
-
"./api": "./dist/api.js",
|
|
33
|
-
"./esbuild": "./dist/esbuild.js",
|
|
34
|
-
"./rolldown": "./dist/rolldown.js",
|
|
35
|
-
"./rollup": "./dist/rollup.js",
|
|
36
|
-
"./rspack": "./dist/rspack.js",
|
|
37
|
-
"./vite": "./dist/vite.js",
|
|
38
|
-
"./webpack": "./dist/webpack.js",
|
|
39
|
-
"./package.json": "./package.json"
|
|
40
|
-
},
|
|
41
|
-
"typesVersions": {
|
|
42
|
-
"*": {
|
|
43
|
-
"*": [
|
|
44
|
-
"./dist/*",
|
|
45
|
-
"./*"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
38
|
"publishConfig": {
|
|
50
39
|
"access": "public"
|
|
51
40
|
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20.19.0"
|
|
43
|
+
},
|
|
52
44
|
"peerDependencies": {
|
|
53
45
|
"esbuild": ">=0.25.0"
|
|
54
46
|
},
|
|
@@ -58,26 +50,25 @@
|
|
|
58
50
|
}
|
|
59
51
|
},
|
|
60
52
|
"dependencies": {
|
|
61
|
-
"unplugin": "^
|
|
62
|
-
"unplugin-utils": "^0.3.
|
|
53
|
+
"unplugin": "^3.0.0",
|
|
54
|
+
"unplugin-utils": "^0.3.1"
|
|
63
55
|
},
|
|
64
56
|
"devDependencies": {
|
|
65
|
-
"@sxzz/eslint-config": "^7.
|
|
66
|
-
"@sxzz/prettier-config": "^2.
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"node": ">=20.18.0"
|
|
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"
|
|
81
72
|
},
|
|
82
73
|
"prettier": "@sxzz/prettier-config",
|
|
83
74
|
"scripts": {
|
|
@@ -86,7 +77,7 @@
|
|
|
86
77
|
"build": "tsdown",
|
|
87
78
|
"dev": "tsdown --watch",
|
|
88
79
|
"test": "vitest",
|
|
89
|
-
"typecheck": "
|
|
80
|
+
"typecheck": "tsgo --noEmit",
|
|
90
81
|
"release": "bumpp"
|
|
91
82
|
}
|
|
92
83
|
}
|
package/dist/api.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Options, OptionsResolved, TransformOptions, resolveOptions } from "./options-DupdgTT1.js";
|
|
2
|
-
import { Buffer } from "node:buffer";
|
|
3
|
-
import * as esbuild0 from "esbuild";
|
|
4
|
-
import { TransformOptions as TransformOptions$1 } from "esbuild";
|
|
5
|
-
|
|
6
|
-
//#region src/core/transform.d.ts
|
|
7
|
-
declare function transformRaw(file: string, isBytes: boolean, transform?: typeof esbuild0.transform, transformFilter?: (id: string | unknown) => boolean, options?: TransformOptions$1): Promise<string | Buffer>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { type Options, type OptionsResolved, type TransformOptions, resolveOptions, transformRaw };
|
package/dist/api.js
DELETED
package/dist/esbuild.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "./options-BTT0I76V.js";
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/esbuild.ts
|
|
5
|
-
/**
|
|
6
|
-
* Esbuild plugin
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // esbuild.config.js
|
|
11
|
-
* import { build } from 'esbuild'
|
|
12
|
-
*
|
|
13
|
-
* build({
|
|
14
|
-
* plugins: [require('unplugin-raw/esbuild')()],
|
|
15
|
-
* })
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
const esbuild = src_default.esbuild;
|
|
19
|
-
var esbuild_default = esbuild;
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { esbuild_default as default, esbuild as "module.exports" };
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
package/dist/rolldown.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "./options-BTT0I76V.js";
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/rolldown.ts
|
|
5
|
-
/**
|
|
6
|
-
* Rolldown plugin
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // rolldown.config.js
|
|
11
|
-
* import Raw from 'unplugin-raw/rolldown'
|
|
12
|
-
*
|
|
13
|
-
* export default {
|
|
14
|
-
* plugins: [Raw()],
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
const rolldown = src_default.rolldown;
|
|
19
|
-
var rolldown_default = rolldown;
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { rolldown_default as default, rolldown as "module.exports" };
|
package/dist/rollup.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "./options-BTT0I76V.js";
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/rollup.ts
|
|
5
|
-
/**
|
|
6
|
-
* Rollup plugin
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // rollup.config.js
|
|
11
|
-
* import Raw from 'unplugin-raw/rollup'
|
|
12
|
-
*
|
|
13
|
-
* export default {
|
|
14
|
-
* plugins: [Raw()],
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
const rollup = src_default.rollup;
|
|
19
|
-
var rollup_default = rollup;
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { rollup_default as default, rollup as "module.exports" };
|
package/dist/rspack.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "./options-BTT0I76V.js";
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/rspack.ts
|
|
5
|
-
/**
|
|
6
|
-
* Rspack plugin
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // rspack.config.js
|
|
11
|
-
* module.exports = {
|
|
12
|
-
* plugins: [require('unplugin-raw/rspack')()],
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
const rspack = src_default.rspack;
|
|
17
|
-
var rspack_default = rspack;
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { rspack_default as default, rspack as "module.exports" };
|
package/dist/webpack.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import "./options-BTT0I76V.js";
|
|
2
|
-
import { src_default } from "./src-CKGRYIxm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/webpack.ts
|
|
5
|
-
/**
|
|
6
|
-
* Webpack plugin
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // webpack.config.js
|
|
11
|
-
* module.exports = {
|
|
12
|
-
* plugins: [require('unplugin-raw/webpack')()],
|
|
13
|
-
* }
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
const webpack = src_default.webpack;
|
|
17
|
-
var webpack_default = webpack;
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { webpack_default as default, webpack as "module.exports" };
|