Skip to content

Blocks: editor.css and related source map is only generated if the entry name contains the string 'block' #264

@roseg43

Description

@roseg43

Describe the bug

When running 10uptoolkit build or 10uptoolkit watch, if the key for an entry doesn't contain the string block then crucial block assets aren't generated. Instead of generating dist/blocks/blockname/editor.css, a file is created in dist/css with the entry key as the filename.

I expect that regardless of what the key is named, if the entry point path contains the block directory as set in paths.config.js then the appropriate assets are generated.

If the current behavior is intended, this should be documented clearly in the package readme.

Steps to Reproduce

  1. Create a basic block example in a project using 10up-toolkit that imports a CSS file in block/index.js
  2. In package.json, create an entry for your new block, making sure not to include the string block in the entry key
  3. Run 10uptoolkit build or 10uptoolkit watch
  4. Observe that the contents of the previously imported CSS file are now in dist/css/example.css instead of dist/blocks/example/editor.css

Screenshots, screen recording, code snippet

Example entry
"image-carousel": "./includes/blocks/image-carousel/index.js",

Environment information

Using 10up-toolkit v4.3.1

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions