@rsbuild/plugin-solid 1.0.3 → 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 +11 -11
- package/dist/index.cjs +34 -67
- package/dist/index.js +15 -28
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
3
|
+
An Rsbuild plugin to provide support for Solid.
|
|
6
4
|
|
|
7
|
-
|
|
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
|
-
|
|
19
|
+
[MIT](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE).
|
package/dist/index.cjs
CHANGED
|
@@ -1,90 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
(()
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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] : {};
|
|
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';
|
|
24
|
+
function pluginSolid(options = {}) {
|
|
47
25
|
return {
|
|
48
26
|
name: PLUGIN_SOLID_NAME,
|
|
49
27
|
setup (api) {
|
|
50
|
-
api.modifyBundlerChain(async (chain,
|
|
51
|
-
let
|
|
52
|
-
const environmentConfig = environment.config;
|
|
28
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isProd, target })=>{
|
|
29
|
+
let environmentConfig = environment.config;
|
|
53
30
|
(0, plugin_babel_namespaceObject.modifyBabelLoaderOptions)({
|
|
54
31
|
chain,
|
|
55
32
|
CHAIN_ID,
|
|
56
|
-
modifier: (babelOptions)=>
|
|
57
|
-
babelOptions.presets = [
|
|
33
|
+
modifier: (babelOptions)=>(babelOptions.presets = [
|
|
58
34
|
[
|
|
59
35
|
src_require.resolve('babel-preset-solid'),
|
|
60
36
|
options.solidPresetOptions || {}
|
|
61
37
|
]
|
|
62
|
-
]
|
|
63
|
-
babelOptions.parserOpts = {
|
|
38
|
+
], babelOptions.parserOpts = {
|
|
64
39
|
plugins: [
|
|
65
40
|
'jsx',
|
|
66
|
-
|
|
41
|
+
"typescript"
|
|
67
42
|
]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
}
|
|
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)
|
|
81
48
|
});
|
|
82
49
|
});
|
|
83
50
|
}
|
|
84
51
|
};
|
|
85
52
|
}
|
|
86
53
|
var __webpack_export_target__ = exports;
|
|
87
|
-
for(var
|
|
88
|
-
|
|
89
|
-
value:
|
|
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
|
|
90
57
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,30 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function pluginSolid() {
|
|
6
|
-
let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
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';
|
|
4
|
+
function pluginSolid(options = {}) {
|
|
7
5
|
return {
|
|
8
6
|
name: PLUGIN_SOLID_NAME,
|
|
9
7
|
setup (api) {
|
|
10
|
-
api.modifyBundlerChain(async (chain,
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
(0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel__.modifyBabelLoaderOptions)({
|
|
8
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isProd, target })=>{
|
|
9
|
+
let environmentConfig = environment.config;
|
|
10
|
+
(0, __WEBPACK_EXTERNAL_MODULE__rsbuild_plugin_babel_2a5a8b08__.modifyBabelLoaderOptions)({
|
|
14
11
|
chain,
|
|
15
12
|
CHAIN_ID,
|
|
16
|
-
modifier: (babelOptions)=>
|
|
17
|
-
babelOptions.presets = [
|
|
13
|
+
modifier: (babelOptions)=>(babelOptions.presets = [
|
|
18
14
|
[
|
|
19
15
|
src_require.resolve('babel-preset-solid'),
|
|
20
16
|
options.solidPresetOptions || {}
|
|
21
17
|
]
|
|
22
|
-
]
|
|
23
|
-
babelOptions.parserOpts = {
|
|
18
|
+
], babelOptions.parserOpts = {
|
|
24
19
|
plugins: [
|
|
25
20
|
'jsx',
|
|
26
|
-
|
|
21
|
+
"typescript"
|
|
27
22
|
]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
}
|
|
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)
|
|
41
28
|
});
|
|
42
29
|
});
|
|
43
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-solid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Solid plugin for Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -23,18 +23,19 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"babel-preset-solid": "^1.9.
|
|
26
|
+
"babel-preset-solid": "^1.9.3",
|
|
27
27
|
"solid-refresh": "0.6.3",
|
|
28
|
-
"@rsbuild/plugin-babel": "1.0.
|
|
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.
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
33
|
+
"typescript": "^5.7.3",
|
|
34
|
+
"@rsbuild/core": "1.2.9",
|
|
35
|
+
"@scripts/test-helper": "1.0.1"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@rsbuild/core": "1.x
|
|
38
|
+
"@rsbuild/core": "1.x"
|
|
38
39
|
},
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"access": "public",
|