10up-toolkit
10up-toolkit copied to clipboard
View entry point not building properly
Describe the bug
There appears to be a conflict in the Webpack configuration when view.scss
or view.css
is present in the block, and the following settings are used:
"useBlockAssets": true,
"useBlockModules": true,
"useScriptModules": true
In this case, the view.ts
/ view.js
is not being bundled properly, as the view CSS seems to be treated as the main entry point, causing the JavaScript to be skipped. As a workaround, I have to use a different name for the view CSS and manually attach it through block.json
using the viewStyle
property.
Steps to Reproduce
- Create a block.
- Set "useBlockAssets" to true in the package.json
- Create view.css / view.scss and view.ts / view.js file.
- Use
10up-toolkit build --watch
to see if the view.ts is bundling.
Screenshots, screen recording, code snippet
No response
Environment information
- Device M2 Pro Sonoma 14.6.1 (23G93)
- 10up toolkit 6.2.2.
WordPress information
N/A
Code of Conduct
- [X] I agree to follow this project's Code of Conduct