Skip to content

refactor(site): webpack configuration #870

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

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Conversation

greyscaled
Copy link
Contributor

This refactor introduces the following changes:

  • re-order and re-comment items to match v1
  • add EnvironmentPlugin for environment variables
  • remove target (unnecessary, we will use browserslist)

Testing for #869

I added the following piece of code to test:

diff --git a/site/src/app.tsx b/site/src/app.tsx
index fcbc455..1a2e19d 100644
--- a/site/src/app.tsx
+++ b/site/src/app.tsx
@@ -10,6 +10,8 @@ import { AppRouter } from "./AppRouter"
 import "./theme/global-fonts"
 
 export const App: React.FC = () => {
+  console.info(`--- INSPECT_XSTATE: ${process.env.INSPECT_XSTATE}`)
+
   return (
     <Router>
       <SWRConfig

and verified the log showed up error-free

This refactor introduces the following changes:

* re-order and re-comment items to match v1
* add EnvironmentPlugin for environment variables
* remove target (unnecessary, we will use browserslist)
@greyscaled greyscaled requested a review from presleyp April 4, 2022 22:10
@greyscaled greyscaled requested a review from a team as a code owner April 4, 2022 22:10
@greyscaled greyscaled self-assigned this Apr 4, 2022
import HtmlWebpackPlugin from "html-webpack-plugin"
import * as path from "path"
import { Configuration, EnvironmentPlugin } from "webpack"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NTS, one of the items i didn't get to on gap week was adding the plugin for ordering imports. I will add this in a follow-up

@codecov
Copy link

codecov bot commented Apr 4, 2022

Codecov Report

Merging #870 (d45c359) into main (8a1ae18) will decrease coverage by 0.10%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #870      +/-   ##
==========================================
- Coverage   65.85%   65.75%   -0.11%     
==========================================
  Files         203      203              
  Lines       13227    13226       -1     
  Branches       87       86       -1     
==========================================
- Hits         8711     8697      -14     
- Misses       3626     3635       +9     
- Partials      890      894       +4     
Flag Coverage Δ
unittest-go- 65.26% <ø> (-0.12%) ⬇️
unittest-go-macos-latest 52.33% <ø> (-0.18%) ⬇️
unittest-go-ubuntu-latest 55.09% <ø> (+0.13%) ⬆️
unittest-go-windows-2022 51.80% <ø> (+0.01%) ⬆️
unittest-js 62.70% <ø> (+0.06%) ⬆️
Impacted Files Coverage Δ
provisioner/echo/serve.go 54.40% <0.00%> (-2.40%) ⬇️
cli/cliui/provisionerjob.go 76.42% <0.00%> (-2.15%) ⬇️
coderd/workspaceresources.go 57.72% <0.00%> (-1.63%) ⬇️
agent/agent.go 67.30% <0.00%> (-1.45%) ⬇️
provisionerd/provisionerd.go 79.58% <0.00%> (-1.03%) ⬇️
peerbroker/proxy.go 57.55% <0.00%> (-0.59%) ⬇️
coderd/provisionerdaemons.go 58.51% <0.00%> (-0.51%) ⬇️
peer/conn.go 79.69% <0.00%> (-0.26%) ⬇️
peer/channel.go 83.62% <0.00%> (+0.58%) ⬆️
cli/cliui/agent.go 82.45% <0.00%> (+5.26%) ⬆️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a1ae18...d45c359. Read the comment docs.

Copy link
Contributor

@presleyp presleyp left a comment

Choose a reason for hiding this comment

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

Thanks! In hindsight the piece I was missing is so obvious haha

@greyscaled
Copy link
Contributor Author

Thanks! In hindsight the piece I was missing is so obvious haha

I want to hesitate in the notion of calling anything nitty webpack config related obvious :p. It took a lot of work to customize v1 to our liking 😂

@greyscaled greyscaled merged commit 473aa6b into main Apr 4, 2022
@greyscaled greyscaled deleted the vapurrmaid/webpack branch April 4, 2022 22:28
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
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 this pull request may close these issues.

3 participants