unplugin-raw 0.6.0 → 0.6.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2023-PRESENT 三咲智子 (https://github.com/sxzz)
3
+ Copyright © 2023-PRESENT Kevin Deng (https://github.com/sxzz)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
- # unplugin-raw [![npm](https://img.shields.io/npm/v/unplugin-raw.svg)](https://npmjs.com/package/unplugin-raw)
1
+ # unplugin-raw
2
2
 
3
- [![Unit Test](https://github.com/unplugin/unplugin-raw/actions/workflows/unit-test.yml/badge.svg)](https://github.com/unplugin/unplugin-raw/actions/workflows/unit-test.yml)
3
+ [![npm version][npm-version-src]][npm-version-href]
4
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
5
+ [![Unit Test][unit-test-src]][unit-test-href]
4
6
 
5
7
  Transform file to a default-export string, and can be transformed by esbuild.
6
8
 
@@ -97,6 +99,8 @@ export interface Options {
97
99
  import text from './js.js?raw'
98
100
  import text2 from './jsx.jsx?raw'
99
101
  import text3 from './ts.ts?raw'
102
+
103
+ // Import attributes (Rolldown doesn't support this syntax)
100
104
  import text4 from './with.js' with { type: 'text' }
101
105
  ```
102
106
 
@@ -110,4 +114,13 @@ import text4 from './with.js' with { type: 'text' }
110
114
 
111
115
  ## License
112
116
 
113
- [MIT](./LICENSE) License © 2023-PRESENT [三咲智子](https://github.com/sxzz)
117
+ [MIT](./LICENSE) License © 2023-PRESENT [Kevin Deng](https://github.com/sxzz)
118
+
119
+ <!-- Badges -->
120
+
121
+ [npm-version-src]: https://img.shields.io/npm/v/unplugin-raw.svg
122
+ [npm-version-href]: https://npmjs.com/package/unplugin-raw
123
+ [npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-raw
124
+ [npm-downloads-href]: https://www.npmcharts.com/compare/unplugin-raw?interval=30
125
+ [unit-test-src]: https://github.com/unplugin/unplugin-raw/actions/workflows/unit-test.yml/badge.svg
126
+ [unit-test-href]: https://github.com/unplugin/unplugin-raw/actions/workflows/unit-test.yml
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/esbuild.ts
5
5
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  export { src_default as default };
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/rolldown.ts
5
5
  /**
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  /**
package/dist/rspack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/rspack.ts
5
5
  /**
@@ -34,8 +34,7 @@ const unplugin = createUnplugin((rawOptions = {}, meta) => {
34
34
  const file = cleanUrl(id);
35
35
  const context = this.getNativeBuildContext?.();
36
36
  const transform = context?.framework === "esbuild" ? context.build.esbuild.transform : void 0;
37
- const contents = await transformRaw(file, false, transform, transformFilter, options.transform ? options.transform.options : void 0);
38
- return contents;
37
+ return await transformRaw(file, false, transform, transformFilter, options.transform ? options.transform.options : void 0);
39
38
  }
40
39
  },
41
40
  esbuild: { setup(build) {
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/vite.ts
5
5
  /**
package/dist/webpack.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./options-BTT0I76V.js";
2
- import { src_default } from "./src-BAcSYQaW.js";
2
+ import { src_default } from "./src-C8tBe-z3.js";
3
3
 
4
4
  //#region src/webpack.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-raw",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Transform file to a default-export string.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "type": "git",
20
20
  "url": "git+https://github.com/unplugin/unplugin-raw.git"
21
21
  },
22
- "author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>",
22
+ "author": "Kevin Deng <sxzz@sxzz.moe>",
23
23
  "funding": "https://github.com/sponsors/sxzz",
24
24
  "files": [
25
25
  "dist"
@@ -29,13 +29,14 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "exports": {
31
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",
32
37
  "./vite": "./dist/vite.js",
33
38
  "./webpack": "./dist/webpack.js",
34
- "./rspack": "./dist/rspack.js",
35
- "./rollup": "./dist/rollup.js",
36
- "./rolldown": "./dist/rolldown.js",
37
- "./esbuild": "./dist/esbuild.js",
38
- "./*": "./*"
39
+ "./package.json": "./package.json"
39
40
  },
40
41
  "typesVersions": {
41
42
  "*": {
@@ -57,22 +58,22 @@
57
58
  }
58
59
  },
59
60
  "dependencies": {
60
- "unplugin": "^2.3.5",
61
- "unplugin-utils": "^0.2.5"
61
+ "unplugin": "^2.3.10",
62
+ "unplugin-utils": "^0.3.0"
62
63
  },
63
64
  "devDependencies": {
64
- "@sxzz/eslint-config": "^7.1.2",
65
- "@sxzz/prettier-config": "^2.2.3",
66
- "@types/node": "^24.2.1",
65
+ "@sxzz/eslint-config": "^7.1.4",
66
+ "@sxzz/prettier-config": "^2.2.4",
67
+ "@types/node": "^24.5.0",
67
68
  "bumpp": "^10.2.3",
68
69
  "esbuild": "^0.25.9",
69
- "eslint": "^9.33.0",
70
+ "eslint": "^9.35.0",
70
71
  "prettier": "^3.6.2",
71
- "rollup": "^4.46.2",
72
- "tsdown": "^0.14.1",
73
- "tsx": "^4.20.4",
72
+ "rolldown": "1.0.0-beta.38",
73
+ "rollup": "^4.50.2",
74
+ "tsdown": "^0.15.1",
74
75
  "typescript": "^5.9.2",
75
- "vite": "^7.1.2",
76
+ "vite": "^7.1.5",
76
77
  "vitest": "^3.2.4"
77
78
  },
78
79
  "engines": {
@@ -86,6 +87,6 @@
86
87
  "dev": "tsdown --watch",
87
88
  "test": "vitest",
88
89
  "typecheck": "tsc --noEmit",
89
- "release": "bumpp && pnpm publish"
90
+ "release": "bumpp"
90
91
  }
91
92
  }