@rsbuild/plugin-toml 0.6.15 → 0.7.0-beta.1

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/index.cjs ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ pluginToml: () => pluginToml
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var pluginToml = () => ({
37
+ name: "rsbuild:toml",
38
+ async setup(api) {
39
+ const { parse } = await import("toml");
40
+ api.transform({ test: /\.toml$/ }, ({ code }) => {
41
+ const parsed = parse(code);
42
+ return `module.exports = ${JSON.stringify(parsed, void 0, " ")};`;
43
+ });
44
+ }
45
+ });
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ pluginToml
49
+ });
package/dist/index.js CHANGED
@@ -1,38 +1,12 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ import { createRequire } from 'module';
2
+ var require = createRequire(import.meta['url']);
3
+
4
+
5
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.49.3_eslint@8.57.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
6
+ import { fileURLToPath } from "url";
7
+ import path from "path";
29
8
 
30
9
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- pluginToml: () => pluginToml
34
- });
35
- module.exports = __toCommonJS(src_exports);
36
10
  var pluginToml = () => ({
37
11
  name: "rsbuild:toml",
38
12
  async setup(api) {
@@ -43,7 +17,6 @@ var pluginToml = () => ({
43
17
  });
44
18
  }
45
19
  });
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
20
+ export {
48
21
  pluginToml
49
- });
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-toml",
3
- "version": "0.6.15",
3
+ "version": "0.7.0-beta.1",
4
4
  "description": "TOML plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -9,29 +9,29 @@
9
9
  "directory": "packages/plugin-toml"
10
10
  },
11
11
  "license": "MIT",
12
- "type": "commonjs",
12
+ "type": "module",
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./dist/index.d.ts",
16
- "import": "./dist/index.mjs",
17
- "default": "./dist/index.js"
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs"
18
18
  }
19
19
  },
20
- "main": "./dist/index.js",
20
+ "main": "./dist/index.cjs",
21
21
  "types": "./dist/index.d.ts",
22
22
  "files": [
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
26
  "toml": "^3.0.0",
27
- "@rsbuild/shared": "0.6.15"
27
+ "@rsbuild/shared": "0.7.0-beta.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "typescript": "^5.4.2",
31
- "@rsbuild/core": "0.6.15"
31
+ "@rsbuild/core": "0.7.0-beta.1"
32
32
  },
33
33
  "peerDependencies": {
34
- "@rsbuild/core": "^0.6.15"
34
+ "@rsbuild/core": "^0.7.0-beta.1"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public",
package/dist/index.mjs DELETED
@@ -1,22 +0,0 @@
1
- import { createRequire } from 'module';
2
- var require = createRequire(import.meta['url']);
3
-
4
-
5
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.49.3_eslint@8.57.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
6
- import { fileURLToPath } from "url";
7
- import path from "path";
8
-
9
- // src/index.ts
10
- var pluginToml = () => ({
11
- name: "rsbuild:toml",
12
- async setup(api) {
13
- const { parse } = await import("toml");
14
- api.transform({ test: /\.toml$/ }, ({ code }) => {
15
- const parsed = parse(code);
16
- return `module.exports = ${JSON.stringify(parsed, void 0, " ")};`;
17
- });
18
- }
19
- });
20
- export {
21
- pluginToml
22
- };