Closed
Description
openedon Jul 21, 2021
Describe the bug
When a CSS entry point is added to package.json, webpack generates an empty .js file. For example, adding the entry "style": "./assets/css/style.css"
outputs css/style.css 20
bytes js/style.js 0 bytes
.
More info about this can be read in the issues webpack-contrib/mini-css-extract-plugin#151 and webpack-contrib/extract-text-webpack-plugin#518.
Steps to Reproduce
- Create a new npm project running
npm init
- Install 10up-toolkit running
npm install --save-dev 10up-toolkit
- Create a CSS file and add an entry point in package.json
...
"10up-toolkit": {
"entry": {
"style": "./assets/css/style.css"
},
...
- Run 10up-toolkit build
- Check at the dist folder the files
style.css
andstyle.js
Expected behavior
Empty scripts removed from output.
Screenshots
Environment information
- Device:
- OS:
- Browser and version:
- WordPress version:
- Plugins and version:
- Theme and version:
-
Site Health Info:
Additional context
A possible workaround is importing CSS file into a JS file. However, there are cases when CSS doesn't have a correspondent JS file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels