@rsbuild/plugin-solid 1.0.4 → 1.0.6
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 +31 -64
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -24
- package/package.json +9 -8
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.
|
|
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.rs/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,88 +1,55 @@
|
|
|
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
|
-
// 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 = (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 = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
10
|
+
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
11
|
+
value: 'Module'
|
|
12
|
+
}), Object.defineProperty(exports1, '__esModule', {
|
|
13
|
+
value: !0
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __webpack_exports__ = {};
|
|
17
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
18
|
+
pluginSolid: ()=>pluginSolid,
|
|
19
|
+
PLUGIN_SOLID_NAME: ()=>PLUGIN_SOLID_NAME
|
|
38
20
|
});
|
|
39
|
-
|
|
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';
|
|
21
|
+
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
22
|
function pluginSolid(options = {}) {
|
|
46
23
|
return {
|
|
47
24
|
name: PLUGIN_SOLID_NAME,
|
|
48
25
|
setup (api) {
|
|
49
26
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isProd, target })=>{
|
|
50
|
-
|
|
27
|
+
let environmentConfig = environment.config;
|
|
51
28
|
(0, plugin_babel_namespaceObject.modifyBabelLoaderOptions)({
|
|
52
29
|
chain,
|
|
53
30
|
CHAIN_ID,
|
|
54
|
-
modifier: (babelOptions)=>
|
|
55
|
-
babelOptions.presets = [
|
|
31
|
+
modifier: (babelOptions)=>(babelOptions.presets = [
|
|
56
32
|
[
|
|
57
33
|
src_require.resolve('babel-preset-solid'),
|
|
58
34
|
options.solidPresetOptions || {}
|
|
59
35
|
]
|
|
60
|
-
]
|
|
61
|
-
babelOptions.parserOpts = {
|
|
36
|
+
], babelOptions.parserOpts = {
|
|
62
37
|
plugins: [
|
|
63
38
|
'jsx',
|
|
64
|
-
|
|
39
|
+
"typescript"
|
|
65
40
|
]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
}
|
|
41
|
+
}, !isProd && environmentConfig.dev.hmr && 'web' === target && (babelOptions.plugins ??= [], babelOptions.plugins.push([
|
|
42
|
+
src_require.resolve('solid-refresh/babel')
|
|
43
|
+
]), chain.resolve.alias.set('solid-refresh', src_require.resolve('solid-refresh/dist/solid-refresh.mjs'))), babelOptions)
|
|
79
44
|
});
|
|
80
45
|
});
|
|
81
46
|
}
|
|
82
47
|
};
|
|
83
48
|
}
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
49
|
+
for(var __webpack_i__ in exports.PLUGIN_SOLID_NAME = __webpack_exports__.PLUGIN_SOLID_NAME, exports.pluginSolid = __webpack_exports__.pluginSolid, __webpack_exports__)-1 === [
|
|
50
|
+
"PLUGIN_SOLID_NAME",
|
|
51
|
+
"pluginSolid"
|
|
52
|
+
].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
|
|
53
|
+
Object.defineProperty(exports, '__esModule', {
|
|
54
|
+
value: !0
|
|
88
55
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { SolidPresetOptions } from './types.js';
|
|
|
3
3
|
export type PluginSolidOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* Options passed to `babel-preset-solid`.
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://npmjs.com/package/babel-preset-solid
|
|
7
7
|
*/
|
|
8
8
|
solidPresetOptions?: SolidPresetOptions;
|
|
9
9
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const PLUGIN_SOLID_NAME = 'rsbuild:solid';
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { modifyBabelLoaderOptions } from "@rsbuild/plugin-babel";
|
|
3
|
+
let src_require = 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
|
-
|
|
11
|
-
|
|
9
|
+
let environmentConfig = environment.config;
|
|
10
|
+
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
|
-
|
|
21
|
+
"typescript"
|
|
25
22
|
]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
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.set('solid-refresh', src_require.resolve('solid-refresh/dist/solid-refresh.mjs'))), babelOptions)
|
|
39
26
|
});
|
|
40
27
|
});
|
|
41
28
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-solid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Solid plugin for Rsbuild",
|
|
5
|
-
"homepage": "https://rsbuild.
|
|
5
|
+
"homepage": "https://rsbuild.rs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/web-infra-dev/rsbuild",
|
|
@@ -23,14 +23,15 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"babel-preset-solid": "^1.9.
|
|
26
|
+
"babel-preset-solid": "^1.9.6",
|
|
27
27
|
"solid-refresh": "0.6.3",
|
|
28
|
-
"@rsbuild/plugin-babel": "1.0.
|
|
28
|
+
"@rsbuild/plugin-babel": "1.0.6"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@rslib/core": "0.11.1",
|
|
31
32
|
"@types/babel__core": "^7.20.5",
|
|
32
|
-
"typescript": "^5.
|
|
33
|
-
"@rsbuild/core": "1.
|
|
33
|
+
"typescript": "^5.9.2",
|
|
34
|
+
"@rsbuild/core": "1.4.14",
|
|
34
35
|
"@scripts/test-helper": "1.0.1"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
@@ -38,11 +39,11 @@
|
|
|
38
39
|
},
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"access": "public",
|
|
41
|
-
"provenance": true,
|
|
42
42
|
"registry": "https://registry.npmjs.org/"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "rslib build",
|
|
46
|
-
"dev": "rslib build --watch"
|
|
46
|
+
"dev": "rslib build --watch",
|
|
47
|
+
"bump": "npx bumpp --no-tag"
|
|
47
48
|
}
|
|
48
49
|
}
|