youtube image
From YouTube: FE Pair Programming - Using webpack vs sprockets for page specific styles

Description

Here's the issue we looked into https://gitlab.com/groups/gitlab-org/-/epics/3694

Here's the resulting MR of this https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35436


0:00 - Jean introduces the issue that GitLab places all page specific styles in the application.scss
3:50 - Do we have anything set up to actually load page specific styles?
5:40 - Nope. It's just one big file.
8:00 - Laying out options and planning next steps
11:50 - Let's start doing this in Webpack with scss-loader
18:20 - We start adding the webpack rule after installing the loader packages
23:20 - Nico starts trying to test it out but the GDK fails for him
32:24 - Jose gracefully takes over and applies Nico's patch
36:20 - Jose creates the missing test.scss and tests it out in local gdk
40:00 - We run into a webpack error and fix it by fixing the regex in another rule
42:00 - Paul tries to sell parcel while we're waiting for webpack
43:00 - It works! Now what is webpack actually doing?
46:45 - We realize how webpack is doing this by inlining styles and there's some problems, and plan on using a mini-css-extract-plugin
53:00 - We look at webpack_helper.rb which is where we load page specific javascript
57:30 - Paul hops off for a second and we load the css extract plugin
1:01:30 - We try to ping the webpack development folder to see what the plugin did
1:07:30 - We talk about Jose's 32 GB of memory
1:12:50 - `webpack-prod` finally finishes and we check out the results