@rsbuild/plugin-stylus 1.0.7 → 1.1.0-beta.1
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 +10 -12
- package/dist/index.js +10 -6
- package/package.json +5 -5
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-stylus
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
An Rsbuild plugin to use Stylus as the CSS preprocessor.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://npmjs.com/package/@rsbuild/plugin-stylus">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-stylus?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-stylus?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-stylus.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-stylus).
|
|
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,23 +1,17 @@
|
|
|
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
|
-
__webpack_require__.n =
|
|
5
|
-
var getter = module && module.__esModule ?
|
|
6
|
-
return module.default;
|
|
7
|
-
} : function() {
|
|
8
|
-
return module;
|
|
9
|
-
};
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
10
6
|
return __webpack_require__.d(getter, {
|
|
11
7
|
a: getter
|
|
12
8
|
}), getter;
|
|
13
|
-
}, __webpack_require__.d =
|
|
9
|
+
}, __webpack_require__.d = (exports1, definition)=>{
|
|
14
10
|
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
15
11
|
enumerable: !0,
|
|
16
12
|
get: definition[key]
|
|
17
13
|
});
|
|
18
|
-
}, __webpack_require__.o =
|
|
19
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
20
|
-
}, __webpack_require__.r = function(exports1) {
|
|
14
|
+
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = function(exports1) {
|
|
21
15
|
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
22
16
|
value: 'Module'
|
|
23
17
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
@@ -41,9 +35,13 @@ let external_reduce_configs_namespaceObject = require("reduce-configs"), src_req
|
|
|
41
35
|
},
|
|
42
36
|
config: options,
|
|
43
37
|
mergeFn: external_deepmerge_default()
|
|
44
|
-
}), rule = chain.module.rule(CHAIN_ID.RULE.STYLUS).test(
|
|
38
|
+
}), test = /\.styl(us)?$/, rule = chain.module.rule(CHAIN_ID.RULE.STYLUS).test(test).merge({
|
|
45
39
|
sideEffects: !0
|
|
46
|
-
}).resolve.preferRelative(!0).end()
|
|
40
|
+
}).resolve.preferRelative(!0).end().resourceQuery({
|
|
41
|
+
not: /raw/
|
|
42
|
+
});
|
|
43
|
+
chain.module.rule(CHAIN_ID.RULE.STYLUS_RAW).test(test).type('asset/source').resourceQuery(/raw/);
|
|
44
|
+
let cssRule = chain.module.rules.get(CHAIN_ID.RULE.CSS);
|
|
47
45
|
for (let id of (rule.dependency(cssRule.get('dependency')), Object.keys(cssRule.uses.entries()))){
|
|
48
46
|
let loader = cssRule.uses.get(id), options = loader.get('options') ?? {}, clonedOptions = external_deepmerge_default()({}, options);
|
|
49
47
|
id === CHAIN_ID.USE.CSS && (clonedOptions.importLoaders += 1), rule.use(id).loader(loader.get('loader')).options(clonedOptions);
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_deepmerge__ from "deepmerge";
|
|
3
|
-
import * as
|
|
4
|
-
let src_require = (0,
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs";
|
|
4
|
+
let src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url), PLUGIN_STYLUS_NAME = 'rsbuild:stylus', pluginStylus = (options)=>({
|
|
5
5
|
name: PLUGIN_STYLUS_NAME,
|
|
6
6
|
setup (api) {
|
|
7
7
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment })=>{
|
|
8
|
-
let { config } = environment, { sourceMap } = config.output, mergedOptions = (0,
|
|
8
|
+
let { config } = environment, { sourceMap } = config.output, mergedOptions = (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__.reduceConfigs)({
|
|
9
9
|
initial: {
|
|
10
10
|
sourceMap: 'boolean' == typeof sourceMap ? sourceMap : sourceMap.css
|
|
11
11
|
},
|
|
12
12
|
config: options,
|
|
13
13
|
mergeFn: __WEBPACK_EXTERNAL_MODULE_deepmerge__.default
|
|
14
|
-
}), rule = chain.module.rule(CHAIN_ID.RULE.STYLUS).test(
|
|
14
|
+
}), test = /\.styl(us)?$/, rule = chain.module.rule(CHAIN_ID.RULE.STYLUS).test(test).merge({
|
|
15
15
|
sideEffects: !0
|
|
16
|
-
}).resolve.preferRelative(!0).end()
|
|
16
|
+
}).resolve.preferRelative(!0).end().resourceQuery({
|
|
17
|
+
not: /raw/
|
|
18
|
+
});
|
|
19
|
+
chain.module.rule(CHAIN_ID.RULE.STYLUS_RAW).test(test).type('asset/source').resourceQuery(/raw/);
|
|
20
|
+
let cssRule = chain.module.rules.get(CHAIN_ID.RULE.CSS);
|
|
17
21
|
for (let id of (rule.dependency(cssRule.get('dependency')), Object.keys(cssRule.uses.entries()))){
|
|
18
22
|
let loader = cssRule.uses.get(id), options = loader.get('options') ?? {}, clonedOptions = (0, __WEBPACK_EXTERNAL_MODULE_deepmerge__.default)({}, options);
|
|
19
23
|
id === CHAIN_ID.USE.CSS && (clonedOptions.importLoaders += 1), rule.use(id).loader(loader.get('loader')).options(clonedOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-stylus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-beta.1",
|
|
4
4
|
"description": "Stylus plugin for Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"stylus-loader": "8.1.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@rslib/core": "0.
|
|
33
|
-
"@types/node": "^22.10
|
|
34
|
-
"typescript": "^5.
|
|
32
|
+
"@rslib/core": "0.5.4",
|
|
33
|
+
"@types/node": "^22.13.10",
|
|
34
|
+
"typescript": "^5.8.2",
|
|
35
35
|
"@scripts/test-helper": "1.0.1",
|
|
36
|
-
"@rsbuild/core": "1.1
|
|
36
|
+
"@rsbuild/core": "1.3.0-beta.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@rsbuild/core": "1.x"
|