@rsbuild/plugin-solid 1.0.2 → 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 +84 -73
- package/{dist-types → dist}/index.d.ts +1 -1
- package/dist/index.js +43 -57
- package/package.json +11 -12
- package/dist-types/package.json +0 -1
- /package/{dist-types → dist}/types.d.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,79 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
chain,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
});
|
package/dist/index.js
CHANGED
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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.
|
|
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
|
|
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
|
|
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.9.
|
|
26
|
+
"babel-preset-solid": "^1.9.2",
|
|
28
27
|
"solid-refresh": "0.6.3",
|
|
29
|
-
"@rsbuild/plugin-babel": "1.0.
|
|
28
|
+
"@rsbuild/plugin-babel": "1.0.2"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
31
|
"@types/babel__core": "^7.20.5",
|
|
33
|
-
"typescript": "^5.
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
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": "
|
|
47
|
-
"dev": "
|
|
45
|
+
"build": "rslib build",
|
|
46
|
+
"dev": "rslib build --watch"
|
|
48
47
|
}
|
|
49
48
|
}
|
package/dist-types/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"//":"This file is for making TypeScript work with moduleResolution node16+.","version":"1.0.0"}
|
|
File without changes
|