You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone https://github.com/AumyF/repro-stylus-esbuild and node dist.js. Though this file is compiled from main.js which compiles a stylus source to css string, it will prints stylus AST object.
Current behavior:
stylus(styl).render() returns a Stylus AST object instead of a compiled CSS string. Because of this stylus-loader does not work on Storybook 7 which uses esbuild internally (storybookjs/storybook#19049).
Because esbuild rewrites this line like var Root = module.exports = function Root2(){, Root.name changes to 'Root2' and implementation depending to such .name property break.
To reproduce:
Clone https://github.com/AumyF/repro-stylus-esbuild and
node dist.js
. Though this file is compiled frommain.js
which compiles a stylus source to css string, it will prints stylus AST object.Current behavior:
stylus(styl).render()
returns a Stylus AST object instead of a compiled CSS string. Because of thisstylus-loader
does not work on Storybook 7 which uses esbuild internally (storybookjs/storybook#19049).Causes:
stylus/lib/nodes/root.js
Line 20 in 73708f3
Because esbuild rewrites this line like
var Root = module.exports = function Root2(){
,Root.name
changes to'Root2'
and implementation depending to such.name
property break.stylus/lib/visitor/index.js
Lines 26 to 30 in 73708f3
Specifying
--keep-names
is a workaround for this issue, but Storybook does not provide to set option of esbuild.Expected behavior:
stylus
works fine after bundling.Also, we should do something about returning as AST object on error.
Environment information:
stylus
version: 0.59.0nodejs
version: 18.15.0esbuild
version: 0.17.17The text was updated successfully, but these errors were encountered: