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 should not minify CSS and JS files when running npm run develop. #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asipple1
Copy link

@asipple1 asipple1 commented Nov 19, 2021

What:
Remove outputStyle: 'compressed' from cssLoader.

Why:
Drupal expects un-minified CSS and right now, we are breaking Drupal coding standards. Drupal can minify, even in separate libraries.

How:
The cmd npm run develop will no longer minify CSS and JS files
the cmd npm run build will minify

To Test:

  • Step 1: Run npm run develop verify the CSS and js files are not minified
  • Step 2 Run npm run build verify the CSS and js files are minified.

@@ -37,7 +37,6 @@ const CSSLoader = {
sourceMap: true,
sassOptions: {
importer: globImporter(),
outputStyle: 'compressed',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but wouldn't we want this to be available when running webpack.prod.js? it uses the same loaders.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Npm run build uses the webpack.prod.js
Npm run develop uses webpack.dev.js

webpack 4 will automatically minify if the mode is production. If the mode is development the css and js files will not be minified.

@ModulesUnraveled
Copy link
Contributor

I'm curious why we'd want to minify at all then. Our typical build process would run the build command (not develop) and pass those results to drupal. So, if i understand correctly, this change will not minify for active development, but anything pushed to a live site would still be minified before it gets to Drupal. Is that correct?

@thejimbirch
Copy link
Collaborator

I can see the need for minified and unminified CSS. Drupal does not want minified files, but Storybook and anything else that would use Storybook could benefit from minified files.

@amazingrando amazingrando added 👉 Needs Work Reviewer has requested changes. labels Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👉 Needs Work Reviewer has requested changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants