-
Notifications
You must be signed in to change notification settings - Fork 980
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
Minify CSS in production builds #1697
Conversation
@dac09 have you tested this via build and/or deploy yet? Attempted to take it for a spin but ran into other issues (possible bug in canary). |
@dac09 Using the PR upgrade command, I tried this out on my local test project that I can confirm works fine on the latest canary. Something seems to be blowing up: Uncaught Error: Cannot find module '@redwoodjs/auth'
at webpackMissingModule (:8910/static/js/app.chunk.js:9132)
at Object.../node_modules/@redwoodjs/web/dist/apollo/index.js (:8910/static/js/app.chunk.js:9132)
at __webpack_require__ (:8910/static/js/runtime-app.bundle.js:854)
at fn (:8910/static/js/runtime-app.bundle.js:151)
at Object.../node_modules/@redwoodjs/web/apollo/index.js (:8910/static/js/app.chunk.js:9099)
at __webpack_require__ (:8910/static/js/runtime-app.bundle.js:854)
at fn (:8910/static/js/runtime-app.bundle.js:151)
at Module../src/index.js (:8910/static/js/app.chunk.js:91347)
at __webpack_require__ (:8910/static/js/runtime-app.bundle.js:854)
at fn (:8910/static/js/runtime-app.bundle.js:151)
at Object.1 (:8910/static/js/app.chunk.js:91508)
at __webpack_require__ (:8910/static/js/runtime-app.bundle.js:854)
at checkDeferredModules (:8910/static/js/runtime-app.bundle.js:46)
at Array.webpackJsonpCallback [as push] (:8910/static/js/runtime-app.bundle.js:33)
at :8910/static/js/app.chunk.js:1 You mentioned something about PR package upgrade not always working. Might that be the case here? |
Yep, verified both in dev and build locally. I don't believe the error is related to this :) |
So I thought about it a little more, and the reason those issues are being raised are that there's an expectation that the css being loaded is as css modules. Maybe something we should think about! |
Testing with PR PackagesThe error I ran into seems to be related to the PR packages I used, specifically I did try this locally, with success, by simply adding the packages and updating Webpack.common in my local project. Shaved a 4mb Tailwind file down to 3mb. Other CSS Concerns
I think we should think about this, indeed. The reason I was asking is that the minification process, although still using one file, might sort out the "order" issue when building for production. I don't know the answer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's loop in @peterp on this one before merging. |
… fix/dm-babel-register * 'fix/dm-babel-register' of github.com:dac09/redwood: Remove bundlesize dependency (redwoodjs#1844) upgrade execa; fix test.js cwd (redwoodjs#1846) Make ESLint configuration aware of "env." (redwoodjs#1827) Use createMany in Seed database example (redwoodjs#1776) Docs: Update contributor workflow to yarn rwt link (redwoodjs#1803) fix(page-loader): Adds types for pageLoadingContext | Fix for pageLoader during prerender (redwoodjs#1832) Minify CSS in production builds (redwoodjs#1697) New contributor workflow (redwoodjs#1792) Improve/template and auth setup tests (redwoodjs#1834)
Fixes #753
While working on the prerendering, I went pretty deep into this stuff! It'll be nice to close this long standing issue.
As per docs here: https://github.com/webpack-contrib/mini-css-extract-plugin#minimizing-for-production