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

Empty js file output from css entry #90

Closed
Rahmon opened this issue Jul 21, 2021 · 0 comments · Fixed by #91
Closed

Empty js file output from css entry #90

Rahmon opened this issue Jul 21, 2021 · 0 comments · Fixed by #91

Comments

@Rahmon
Copy link
Contributor

Rahmon commented 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

  1. Create a new npm project running npm init
  2. Install 10up-toolkit running npm install --save-dev 10up-toolkit
  3. Create a CSS file and add an entry point in package.json
...
"10up-toolkit": {
  "entry": {
   "style": "./assets/css/style.css"
  },
...
  1. Run 10up-toolkit build
  2. Check at the dist folder the files style.css and style.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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant