@rsbuild/plugin-solid 1.0.4 → 1.0.5

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
@@ -1,19 +1,19 @@
1
- <p align="center">
2
- <a href="https://rsbuild.dev" target="blank"><img src="https://github.com/web-infra-dev/rsbuild/assets/7237365/84abc13e-b620-468f-a90b-dbf28e7e9427" alt="Rsbuild Logo" /></a>
3
- </p>
1
+ # @rsbuild/plugin-solid
4
2
 
5
- # Rsbuild
3
+ An Rsbuild plugin to provide support for Solid.
6
4
 
7
- The Rspack-based build tool. It's fast, out-of-the-box and extensible.
5
+ <p>
6
+ <a href="https://npmjs.com/package/@rsbuild/plugin-solid">
7
+ <img src="https://img.shields.io/npm/v/@rsbuild/plugin-solid?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8
+ </a>
9
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10
+ <a href="https://npmcharts.com/compare/@rsbuild/plugin-solid?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-solid.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11
+ </p>
8
12
 
9
13
  ## Documentation
10
14
 
11
- https://rsbuild.dev/
12
-
13
- ## Contributing
14
-
15
- Please read the [Contributing Guide](https://github.com/web-infra-dev/rsbuild/blob/main/CONTRIBUTING.md).
15
+ See [Documentation](https://rsbuild.dev/plugins/list/plugin-solid).
16
16
 
17
17
  ## License
18
18
 
19
- Rsbuild is [MIT licensed](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE).
19
+ [MIT](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE).
package/dist/index.cjs CHANGED
@@ -1,88 +1,57 @@
1
1
  "use strict";
2
- // The require scope
2
+ let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
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
4
+ __webpack_require__.d = function(exports1, definition) {
5
+ for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
6
+ enumerable: !0,
7
+ get: definition[key]
8
+ });
9
+ }, __webpack_require__.o = function(obj, prop) {
10
+ return Object.prototype.hasOwnProperty.call(obj, prop);
11
+ }, __webpack_require__.r = function(exports1) {
12
+ 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
13
+ value: 'Module'
14
+ }), Object.defineProperty(exports1, '__esModule', {
15
+ value: !0
16
+ });
17
+ };
18
+ var __webpack_exports__ = {};
19
+ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
20
+ PLUGIN_SOLID_NAME: ()=>PLUGIN_SOLID_NAME,
21
+ pluginSolid: ()=>pluginSolid
38
22
  });
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';
23
+ let external_node_module_namespaceObject = require("node:module"), plugin_babel_namespaceObject = require("@rsbuild/plugin-babel"), src_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), PLUGIN_SOLID_NAME = 'rsbuild:solid';
45
24
  function pluginSolid(options = {}) {
46
25
  return {
47
26
  name: PLUGIN_SOLID_NAME,
48
27
  setup (api) {
49
28
  api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isProd, target })=>{
50
- const environmentConfig = environment.config;
29
+ let environmentConfig = environment.config;
51
30
  (0, plugin_babel_namespaceObject.modifyBabelLoaderOptions)({
52
31
  chain,
53
32
  CHAIN_ID,
54
- modifier: (babelOptions)=>{
55
- babelOptions.presets = [
33
+ modifier: (babelOptions)=>(babelOptions.presets = [
56
34
  [
57
35
  src_require.resolve('babel-preset-solid'),
58
36
  options.solidPresetOptions || {}
59
37
  ]
60
- ];
61
- babelOptions.parserOpts = {
38
+ ], babelOptions.parserOpts = {
62
39
  plugins: [
63
40
  'jsx',
64
- 'typescript'
41
+ "typescript"
65
42
  ]
66
- };
67
- const usingHMR = !isProd && environmentConfig.dev.hmr && 'web' === target;
68
- if (usingHMR) {
69
- babelOptions.plugins ??= [];
70
- babelOptions.plugins.push([
71
- src_require.resolve('solid-refresh/babel')
72
- ]);
73
- chain.resolve.alias.merge({
74
- 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
75
- });
76
- }
77
- return babelOptions;
78
- }
43
+ }, !isProd && environmentConfig.dev.hmr && 'web' === target && (babelOptions.plugins ??= [], babelOptions.plugins.push([
44
+ src_require.resolve('solid-refresh/babel')
45
+ ]), chain.resolve.alias.merge({
46
+ 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
47
+ })), babelOptions)
79
48
  });
80
49
  });
81
50
  }
82
51
  };
83
52
  }
84
53
  var __webpack_export_target__ = exports;
85
- for(var i in __webpack_exports__)__webpack_export_target__[i] = __webpack_exports__[i];
86
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
87
- value: true
54
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
55
+ __webpack_exports__.__esModule && Object.defineProperty(__webpack_export_target__, '__esModule', {
56
+ value: !0
88
57
  });
package/dist/index.js CHANGED
@@ -1,41 +1,30 @@
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';
1
+ import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel_2a5a8b08__ from "@rsbuild/plugin-babel";
3
+ let src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url), PLUGIN_SOLID_NAME = 'rsbuild:solid';
5
4
  function pluginSolid(options = {}) {
6
5
  return {
7
6
  name: PLUGIN_SOLID_NAME,
8
7
  setup (api) {
9
8
  api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isProd, target })=>{
10
- const environmentConfig = environment.config;
11
- (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel__.modifyBabelLoaderOptions)({
9
+ let environmentConfig = environment.config;
10
+ (0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel_2a5a8b08__.modifyBabelLoaderOptions)({
12
11
  chain,
13
12
  CHAIN_ID,
14
- modifier: (babelOptions)=>{
15
- babelOptions.presets = [
13
+ modifier: (babelOptions)=>(babelOptions.presets = [
16
14
  [
17
15
  src_require.resolve('babel-preset-solid'),
18
16
  options.solidPresetOptions || {}
19
17
  ]
20
- ];
21
- babelOptions.parserOpts = {
18
+ ], babelOptions.parserOpts = {
22
19
  plugins: [
23
20
  'jsx',
24
- 'typescript'
21
+ "typescript"
25
22
  ]
26
- };
27
- const usingHMR = !isProd && environmentConfig.dev.hmr && 'web' === target;
28
- if (usingHMR) {
29
- babelOptions.plugins ??= [];
30
- babelOptions.plugins.push([
31
- src_require.resolve('solid-refresh/babel')
32
- ]);
33
- chain.resolve.alias.merge({
34
- 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
35
- });
36
- }
37
- return babelOptions;
38
- }
23
+ }, !isProd && environmentConfig.dev.hmr && 'web' === target && (babelOptions.plugins ??= [], babelOptions.plugins.push([
24
+ src_require.resolve('solid-refresh/babel')
25
+ ]), chain.resolve.alias.merge({
26
+ 'solid-refresh': src_require.resolve('solid-refresh/dist/solid-refresh.mjs')
27
+ })), babelOptions)
39
28
  });
40
29
  });
41
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-solid",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Solid plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -25,12 +25,13 @@
25
25
  "dependencies": {
26
26
  "babel-preset-solid": "^1.9.3",
27
27
  "solid-refresh": "0.6.3",
28
- "@rsbuild/plugin-babel": "1.0.3"
28
+ "@rsbuild/plugin-babel": "1.0.4"
29
29
  },
30
30
  "devDependencies": {
31
+ "@rslib/core": "0.4.1",
31
32
  "@types/babel__core": "^7.20.5",
32
- "typescript": "^5.6.3",
33
- "@rsbuild/core": "1.0.19",
33
+ "typescript": "^5.7.3",
34
+ "@rsbuild/core": "1.2.9",
34
35
  "@scripts/test-helper": "1.0.1"
35
36
  },
36
37
  "peerDependencies": {