@rsbuild/plugin-solid 1.0.1 → 1.0.3

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 CHANGED
@@ -1,79 +1,90 @@
1
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
- PLUGIN_SOLID_NAME: () => PLUGIN_SOLID_NAME,
34
- pluginSolid: () => pluginSolid
2
+ // The require scope
3
+ var __webpack_require__ = {};
4
+ /************************************************************************/ // webpack/runtime/define_property_getters
5
+ (()=>{
6
+ __webpack_require__.d = function(exports1, definition) {
7
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
8
+ enumerable: true,
9
+ get: definition[key]
10
+ });
11
+ };
12
+ })();
13
+ // webpack/runtime/has_own_property
14
+ (()=>{
15
+ __webpack_require__.o = function(obj, prop) {
16
+ return Object.prototype.hasOwnProperty.call(obj, prop);
17
+ };
18
+ })();
19
+ // webpack/runtime/make_namespace_object
20
+ (()=>{
21
+ // define __esModule on exports
22
+ __webpack_require__.r = function(exports1) {
23
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
24
+ value: 'Module'
25
+ });
26
+ Object.defineProperty(exports1, '__esModule', {
27
+ value: true
28
+ });
29
+ };
30
+ })();
31
+ /************************************************************************/ var __webpack_exports__ = {};
32
+ // ESM COMPAT FLAG
33
+ __webpack_require__.r(__webpack_exports__);
34
+ // EXPORTS
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ PLUGIN_SOLID_NAME: ()=>/* binding */ PLUGIN_SOLID_NAME,
37
+ pluginSolid: ()=>/* binding */ pluginSolid
35
38
  });
36
- module.exports = __toCommonJS(src_exports);
37
- var import_plugin_babel = require("@rsbuild/plugin-babel");
38
- var PLUGIN_SOLID_NAME = "rsbuild:solid";
39
- function pluginSolid(options = {}) {
40
- return {
41
- name: PLUGIN_SOLID_NAME,
42
- setup(api) {
43
- api.modifyBundlerChain(
44
- async (chain, { CHAIN_ID, environment, isProd, target }) => {
45
- const environmentConfig = environment.config;
46
- (0, import_plugin_babel.modifyBabelLoaderOptions)({
47
- chain,
48
- CHAIN_ID,
49
- modifier: (babelOptions) => {
50
- babelOptions.presets = [
51
- [
52
- require.resolve("babel-preset-solid"),
53
- options.solidPresetOptions || {}
54
- ]
55
- ];
56
- babelOptions.parserOpts = { plugins: ["jsx", "typescript"] };
57
- const usingHMR = !isProd && environmentConfig.dev.hmr && target === "web";
58
- if (usingHMR) {
59
- babelOptions.plugins ??= [];
60
- babelOptions.plugins.push([
61
- require.resolve("solid-refresh/babel")
62
- ]);
63
- chain.resolve.alias.merge({
64
- "solid-refresh": require.resolve("solid-refresh/dist/solid-refresh.mjs")
39
+ const external_node_module_namespaceObject = require("node:module");
40
+ const plugin_babel_namespaceObject = require("@rsbuild/plugin-babel");
41
+ const src_require = (0, external_node_module_namespaceObject.createRequire)(/*#__PURE__*/ function() {
42
+ return 'undefined' == typeof document ? new (module.require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
43
+ }());
44
+ const PLUGIN_SOLID_NAME = 'rsbuild:solid';
45
+ function pluginSolid() {
46
+ let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
47
+ return {
48
+ name: PLUGIN_SOLID_NAME,
49
+ setup (api) {
50
+ api.modifyBundlerChain(async (chain, param)=>{
51
+ let { CHAIN_ID, environment, isProd, target } = param;
52
+ const environmentConfig = environment.config;
53
+ (0, plugin_babel_namespaceObject.modifyBabelLoaderOptions)({
54
+ chain,
55
+ CHAIN_ID,
56
+ modifier: (babelOptions)=>{
57
+ babelOptions.presets = [
58
+ [
59
+ src_require.resolve('babel-preset-solid'),
60
+ options.solidPresetOptions || {}
61
+ ]
62
+ ];
63
+ babelOptions.parserOpts = {
64
+ plugins: [
65
+ 'jsx',
66
+ 'typescript'
67
+ ]
68
+ };
69
+ const usingHMR = !isProd && environmentConfig.dev.hmr && 'web' === target;
70
+ if (usingHMR) {
71
+ babelOptions.plugins ??= [];
72
+ babelOptions.plugins.push([
73
+ src_require.resolve('solid-refresh/babel')
74
+ ]);
75
+ chain.resolve.alias.merge({
76
+ 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
77
+ });
78
+ }
79
+ return babelOptions;
80
+ }
65
81
  });
66
- }
67
- return babelOptions;
68
- }
69
- });
82
+ });
70
83
  }
71
- );
72
- }
73
- };
84
+ };
74
85
  }
75
- // Annotate the CommonJS export names for ESM import in node:
76
- 0 && (module.exports = {
77
- PLUGIN_SOLID_NAME,
78
- pluginSolid
86
+ var __webpack_export_target__ = exports;
87
+ for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
88
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
89
+ value: true
79
90
  });
@@ -1,5 +1,5 @@
1
1
  import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { SolidPresetOptions } from './types';
2
+ import type { SolidPresetOptions } from './types.js';
3
3
  export type PluginSolidOptions = {
4
4
  /**
5
5
  * Options passed to `babel-preset-solid`.
package/dist/index.js CHANGED
@@ -1,60 +1,46 @@
1
- import { createRequire } from 'module';
2
- var require = createRequire(import.meta['url']);
3
-
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined")
8
- return require.apply(this, arguments);
9
- throw Error('Dynamic require of "' + x + '" is not supported');
10
- });
11
-
12
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.59.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
13
- import path from "path";
14
- import { fileURLToPath } from "url";
15
-
16
- // src/index.ts
17
- import { modifyBabelLoaderOptions } from "@rsbuild/plugin-babel";
18
- var PLUGIN_SOLID_NAME = "rsbuild:solid";
19
- function pluginSolid(options = {}) {
20
- return {
21
- name: PLUGIN_SOLID_NAME,
22
- setup(api) {
23
- api.modifyBundlerChain(
24
- async (chain, { CHAIN_ID, environment, isProd, target }) => {
25
- const environmentConfig = environment.config;
26
- modifyBabelLoaderOptions({
27
- chain,
28
- CHAIN_ID,
29
- modifier: (babelOptions) => {
30
- babelOptions.presets = [
31
- [
32
- __require.resolve("babel-preset-solid"),
33
- options.solidPresetOptions || {}
34
- ]
35
- ];
36
- babelOptions.parserOpts = { plugins: ["jsx", "typescript"] };
37
- const usingHMR = !isProd && environmentConfig.dev.hmr && target === "web";
38
- if (usingHMR) {
39
- babelOptions.plugins ??= [];
40
- babelOptions.plugins.push([
41
- __require.resolve("solid-refresh/babel")
42
- ]);
43
- chain.resolve.alias.merge({
44
- "solid-refresh": __require.resolve(
45
- "solid-refresh/dist/solid-refresh.mjs"
46
- )
1
+ import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel__ from "@rsbuild/plugin-babel";
3
+ const src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url);
4
+ const PLUGIN_SOLID_NAME = 'rsbuild:solid';
5
+ function pluginSolid() {
6
+ let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
7
+ return {
8
+ name: PLUGIN_SOLID_NAME,
9
+ setup (api) {
10
+ api.modifyBundlerChain(async (chain, param)=>{
11
+ let { CHAIN_ID, environment, isProd, target } = param;
12
+ const environmentConfig = environment.config;
13
+ (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel__.modifyBabelLoaderOptions)({
14
+ chain,
15
+ CHAIN_ID,
16
+ modifier: (babelOptions)=>{
17
+ babelOptions.presets = [
18
+ [
19
+ src_require.resolve('babel-preset-solid'),
20
+ options.solidPresetOptions || {}
21
+ ]
22
+ ];
23
+ babelOptions.parserOpts = {
24
+ plugins: [
25
+ 'jsx',
26
+ 'typescript'
27
+ ]
28
+ };
29
+ const usingHMR = !isProd && environmentConfig.dev.hmr && 'web' === target;
30
+ if (usingHMR) {
31
+ babelOptions.plugins ??= [];
32
+ babelOptions.plugins.push([
33
+ src_require.resolve('solid-refresh/babel')
34
+ ]);
35
+ chain.resolve.alias.merge({
36
+ 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
37
+ });
38
+ }
39
+ return babelOptions;
40
+ }
47
41
  });
48
- }
49
- return babelOptions;
50
- }
51
- });
42
+ });
52
43
  }
53
- );
54
- }
55
- };
44
+ };
56
45
  }
57
- export {
58
- PLUGIN_SOLID_NAME,
59
- pluginSolid
60
- };
46
+ export { PLUGIN_SOLID_NAME, pluginSolid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-solid",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Solid plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -12,27 +12,26 @@
12
12
  "type": "module",
13
13
  "exports": {
14
14
  ".": {
15
- "types": "./dist-types/index.d.ts",
15
+ "types": "./dist/index.d.ts",
16
16
  "import": "./dist/index.js",
17
17
  "require": "./dist/index.cjs"
18
18
  }
19
19
  },
20
20
  "main": "./dist/index.cjs",
21
- "types": "./dist-types/index.d.ts",
21
+ "types": "./dist/index.d.ts",
22
22
  "files": [
23
- "dist",
24
- "dist-types"
23
+ "dist"
25
24
  ],
26
25
  "dependencies": {
27
- "babel-preset-solid": "^1.8.22",
26
+ "babel-preset-solid": "^1.9.2",
28
27
  "solid-refresh": "0.6.3",
29
- "@rsbuild/plugin-babel": "1.0.1"
28
+ "@rsbuild/plugin-babel": "1.0.2"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@types/babel__core": "^7.20.5",
33
- "typescript": "^5.5.2",
34
- "@rsbuild/core": "1.0.1",
35
- "@scripts/test-helper": "1.0.1"
32
+ "typescript": "^5.6.3",
33
+ "@scripts/test-helper": "1.0.1",
34
+ "@rsbuild/core": "1.0.14"
36
35
  },
37
36
  "peerDependencies": {
38
37
  "@rsbuild/core": "1.x || ^1.0.1-rc.0"
@@ -43,7 +42,7 @@
43
42
  "registry": "https://registry.npmjs.org/"
44
43
  },
45
44
  "scripts": {
46
- "build": "modern build",
47
- "dev": "modern build --watch"
45
+ "build": "rslib build",
46
+ "dev": "rslib build --watch"
48
47
  }
49
48
  }
@@ -1 +0,0 @@
1
- {"//":"This file is for making TypeScript work with moduleResolution node16+.","version":"1.0.0"}
File without changes