Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
16ae8d7
refactor: resolve eslint problems
alexander-akait Jul 30, 2025
3ad28ef
test: debug
alexander-akait Jul 30, 2025
cf6fdfe
test: debug
alexander-akait Jul 30, 2025
c5cb4dc
test: debug
alexander-akait Jul 30, 2025
1d5f4a9
test: debug
alexander-akait Jul 30, 2025
83f6c58
test: debug
alexander-akait Jul 30, 2025
c62bcb2
test: debug
alexander-akait Jul 30, 2025
722dbbb
test: debug
alexander-akait Jul 30, 2025
a5c1dda
test: debug
alexander-akait Jul 30, 2025
d6c3bc4
test: debug
alexander-akait Jul 30, 2025
5f89a3a
test: debug
alexander-akait Jul 30, 2025
e6d19c3
test: debug
alexander-akait Jul 30, 2025
09b4232
test: debug
alexander-akait Jul 30, 2025
1c15985
test: debug
alexander-akait Jul 30, 2025
daee8b8
test: debug
alexander-akait Jul 30, 2025
0abd84e
test: debug
alexander-akait Jul 30, 2025
4ee34e6
test: debug
alexander-akait Jul 30, 2025
bc7ce0f
test: debug
alexander-akait Jul 30, 2025
c95493e
test: debug
alexander-akait Jul 31, 2025
6594b2b
test: debug
alexander-akait Aug 15, 2025
7185b22
test: debug
alexander-akait Aug 15, 2025
ffba003
test: debug
alexander-akait Aug 15, 2025
d733d5f
test: debug
alexander-akait Aug 15, 2025
cc80a80
test: debug
alexander-akait Aug 15, 2025
4457219
test: debug
alexander-akait Aug 15, 2025
9b097c3
test: debug
alexander-akait Aug 15, 2025
9a67696
test: debug
alexander-akait Aug 15, 2025
358a4fc
chore: remove unused deps
alexander-akait Aug 15, 2025
1139f19
test: debug
alexander-akait Aug 15, 2025
513f48e
test: debug
alexander-akait Aug 15, 2025
dc40ec8
test: debug
alexander-akait Aug 15, 2025
050d790
test: debug
alexander-akait Aug 15, 2025
38fd7c8
test: debug
alexander-akait Aug 15, 2025
dc9b4a7
test: debug
alexander-akait Aug 15, 2025
13164ab
test: debug
alexander-akait Aug 15, 2025
be2b6b2
test: debug
alexander-akait Aug 15, 2025
5ff6eb8
test: debug
alexander-akait Aug 15, 2025
d2116e2
test: debug
alexander-akait Aug 15, 2025
89e71e4
test: debug
alexander-akait Aug 15, 2025
843345b
test: debug
alexander-akait Aug 15, 2025
51853c7
test: debug
alexander-akait Aug 15, 2025
9cf5f51
test: debug
alexander-akait Aug 15, 2025
b0815f0
test: debug
alexander-akait Aug 15, 2025
5136bba
test: debug
alexander-akait Aug 15, 2025
dc3456e
test: debug
alexander-akait Aug 15, 2025
4c537bb
test: debug
alexander-akait Aug 15, 2025
56fac29
test: debug
alexander-akait Aug 15, 2025
5469cd7
test: debug
alexander-akait Aug 15, 2025
dbdf09c
test: debug
alexander-akait Aug 15, 2025
42f25df
test: debug
alexander-akait Aug 15, 2025
8001d52
test: debug
alexander-akait Aug 15, 2025
a98bb78
test: debug
alexander-akait Aug 15, 2025
a5070d1
test: debug
alexander-akait Aug 15, 2025
3ee2033
test: debug
alexander-akait Aug 17, 2025
23b0a24
test: debug
alexander-akait Aug 18, 2025
f4bc3c0
test: debug
alexander-akait Aug 18, 2025
46f5236
test: debug
alexander-akait Aug 18, 2025
8fb47a4
test: debug
alexander-akait Aug 18, 2025
c39e73e
test: debug
alexander-akait Aug 18, 2025
8e7187e
test: debug
alexander-akait Aug 18, 2025
fa13667
test: debug
alexander-akait Aug 18, 2025
330c9f4
test: debug
alexander-akait Aug 18, 2025
e9ea500
test: debug
alexander-akait Aug 18, 2025
ba7a69f
test: debug
alexander-akait Aug 18, 2025
0dcab10
test: debug
alexander-akait Aug 18, 2025
fd22c14
test: debug
alexander-akait Aug 18, 2025
ac1cd63
test: debug
alexander-akait Aug 18, 2025
5cbd811
test: debug
alexander-akait Aug 18, 2025
ff4f990
test: debug
alexander-akait Aug 18, 2025
1fa7238
test: debug
alexander-akait Aug 18, 2025
8b217db
test: debug
alexander-akait Aug 18, 2025
079e3f6
test: debug
alexander-akait Aug 18, 2025
4857299
test: debug
alexander-akait Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ Type:
```ts
type stylusOptions =
| {
use: Array<string | Function>;
include: Array<string>;
import: Array<string>;
define: Array;
use: (string | ((stylusOptions: StylusOptions) => void))[];
include: string[];
import: string[];
define: any[];
includeCSS: false;
resolveURL: boolean | Object;
resolveURL: boolean | object;
lineNumbers: boolean;
hoistAtrules: boolean;
compress: boolean;
}
| (loaderContext: LoaderContext) => Array<string>;
| ((loaderContext: LoaderContext) => string[]);
```

Default: `{}`
Expand Down Expand Up @@ -337,11 +337,11 @@ Type:
```ts
type additionalData =
| string
| (
| ((
content: string | Buffer,
loaderContext: LoaderContext,
meta: any
) => string;
meta: any,
) => string);
```

Default: `undefined`
Expand Down Expand Up @@ -455,7 +455,7 @@ module.exports = {
Type:

```ts
type implementation = Function | string;
type implementation = (() => typeof import("stylus")) | string;
```

The `implementation` option allows you to specify which `Stylus implementation` to use.
Expand Down
4 changes: 3 additions & 1 deletion bench/fixtures/imports/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const path = require("node:path");

module.exports = {
context: __dirname,
entry: "./index.js",
output: {
path: `${__dirname}/tmp`,
path: path.join(__dirname, "./tmp"),
filename: "bundle.js",
},
module: {
Expand Down
13 changes: 6 additions & 7 deletions bench/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
const fs = require("node:fs");
const path = require("node:path");

const Benchmark = require("benchmark");

const MemoryFileSystem = require("memory-fs");
const { Volume, createFsFromVolume } = require("memfs");
const stylus = require("stylus");
const webpack = require("webpack");

const importWebpackConfig = require("./fixtures/imports/webpack.config");

function resolveOnComplete(fn) {
return () => {
return (...args) => {
const _this = this;
const args = arguments;

return new Promise((resolve) => {
const result = fn.apply(_this, args);
Expand All @@ -29,7 +26,8 @@ const source = fs.readFileSync(sourceFile).toString();
const styl = stylus(source);

const compiler = webpack(importWebpackConfig);
compiler.outputFileSystem = new MemoryFileSystem();

compiler.outputFileSystem = createFsFromVolume(new Volume());

Promise.resolve()
.then(
Expand Down Expand Up @@ -60,14 +58,15 @@ Promise.resolve()
return suite;
}),
)
// eslint-disable-next-line unicorn/prefer-top-level-await
.then(
resolveOnComplete(() => {
const suite = new Benchmark.Suite();
suite
.add("Stylus loader", {
defer: true,
fn(deferred) {
compiler.run((error, stats) => {
compiler.run((error, _stats) => {
if (error) {
throw error;
}
Expand Down
Loading
Loading