talss89 / bud-wp-editor-query

Split WordPress editor styles into separate stylesheets
MIT License
13 stars 0 forks source link

No assets are emitted when using `bud-sass` #1

Closed strarsis closed 1 year ago

strarsis commented 1 year ago

Great that you made a bud extension for this!

Could you help me to get this working?

  1. git clone https://github.com/strarsis/sage10-scss
  2. cd sage10-scss
  3. git checkout editor-extract-budplugin
  4. nvm use
  5. npm install
  6. npm run build Note that in public/css/editor.[hash].css the example styles in editor extract query (in resources/styles/app.scss) were not added.
talss89 commented 1 year ago

Thanks a lot for testing this out.

It is a bug - the logic doesn't run for bud-sass.

I've fixed, and pushed a new NPM release - 0.0.4. I've also raised a PR to simply upgrade your bud dependencies to 6.16.1, which is required by the extension (I'll add to the readme).

Is that working for you as expected now?

strarsis commented 1 year ago

@talss89: Thanks for looking into this!

I use 0.0.4 of the package (merged PR), but the editor styles do not appear in the output yet.

talss89 commented 1 year ago

That's strange. Does it work if you delete ./public?

I've just opened a codespace on that branch and run npm bud build, and ./public/editor/app.css contains the editor output.

Quite keen to track this issue down.

strarsis commented 1 year ago

@talss89: I manually deleted the ./public directory, I also deleted the whole project folder and re-cloned it.

npm ls lists bud-wp-editor-query@0.0.4.

  1. git clone git@github.com:strarsis/sage10-scss.git
  2. cd sage10-scss
  3. git checkout editor-extract-budplugin
  4. nvm use
  5. npm install
  6. npm run build
  7. In public/css/editor.7315cb.css the editor-only styles (.your-styles-here { color: blue; }) are not added.

I also used npm cache clean --force as I had issues with npm packages in the near past.

talss89 commented 1 year ago

Thanks.

There should be a ./public/editor directory created, with app.css inside. The editor styles won't be emitted to public/css/editor.7315cb.css

talss89 commented 1 year ago

Here's what I'm seeing: https://asciinema.org/a/2grbcGxtL1oMxHlHSxTJn6eCc

strarsis commented 1 year ago

@talss89: This was my mistake! I did not notice that the editor-specific styles are not added to editor.css but rather to a file of the same name in editor/ directory. This works of course. Thanks for looking into this.

It works perfectly now, thank you!