Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack doesn't detect new scss files #81

Closed
aurooba opened this issue Feb 14, 2023 · 4 comments · Fixed by #164
Closed

Webpack doesn't detect new scss files #81

aurooba opened this issue Feb 14, 2023 · 4 comments · Fixed by #164
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aurooba
Copy link
Collaborator

aurooba commented Feb 14, 2023

So I'm encountering an issue that I have yet to solve:

– webpack doesn't want to compile new scss files, even though it detects their existence. There is some form of caching happening, which I've tried to disable in a variety of ways and have failed to do so.

So for the moment, I've added a new npm script called watch, which actually just runs build whenever it detects changes to any js, css, scss, jsonc files in the src folder. This is not ideal because build is an optimized version of the files and takes longer than start, but it should do the trick for now until I find the appropriate fix for this.

So, this is now ready for your review @bacoords.

Originally posted by @aurooba in #72 (comment)

@aurooba aurooba added the bug Something isn't working label Feb 14, 2023
@aurooba aurooba added this to the Release 0.1 milestone Feb 27, 2023
@bacoords
Copy link
Owner

Same thing happens when building out a block. I had to stop and restart to get my assets built

@aurooba
Copy link
Collaborator Author

aurooba commented Feb 28, 2023

Ooh interesting. This means that wp-scripts isn't handling the directory change very well. This is very good to know.

@aurooba
Copy link
Collaborator Author

aurooba commented Feb 28, 2023

@bacoords I just tested this and wasn't able to reproduce this error when adding a new stylesheet to a block. Can you tell me what you did on your end?

What I tried:

I added a new stylesheet called test.scss with some styles in it for the hello-world block, while npm run watch was going and imported it into edit.js. And I was able to add styles to it and see it compile into index.css

@bacoords
Copy link
Owner

The steps were:

  • start was running
  • added a new folder for a new block
  • added block.json and the js files to src/blocks/name
  • none of the js was compiled/moved to blocks/name, I think just the block.json was
  • stopped and started the build and everything was generated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants