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

[v3] migrate graphiql to vite and react compiler #3826

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f590ae4
aa
dimaMachina Dec 11, 2024
810b0b2
aa
dimaMachina Dec 11, 2024
8066724
aa
dimaMachina Dec 11, 2024
4039e39
aa
dimaMachina Dec 11, 2024
4b7e458
aa
dimaMachina Dec 11, 2024
777eac5
aa
dimaMachina Dec 11, 2024
3786aca
aa
dimaMachina Dec 11, 2024
e1260f4
aa
dimaMachina Dec 11, 2024
1c5c46f
aa
dimaMachina Dec 11, 2024
16424ae
aa
dimaMachina Dec 11, 2024
dae03ba
aa
dimaMachina Dec 11, 2024
e1b3cc5
aa
dimaMachina Dec 11, 2024
67a2250
aa
dimaMachina Dec 11, 2024
2be769b
[skip ci]
dimaMachina Dec 13, 2024
785c103
fix
dimaMachina Dec 13, 2024
9a0a3cd
migrate `graphiql` from `jest` to `vitest`
dimaMachina Dec 13, 2024
a862023
add .js extension
dimaMachina Dec 13, 2024
3f3472a
add .js extension
dimaMachina Dec 13, 2024
5fd2901
Merge branch 'do-not-bundle-codemirror' into graphiql-vitest
dimaMachina Dec 13, 2024
be801e4
upd
dimaMachina Dec 13, 2024
398b087
upd
dimaMachina Dec 13, 2024
a337e82
Merge branch 'do-not-bundle-codemirror' into graphiql-vitest
dimaMachina Dec 13, 2024
731082d
upd
dimaMachina Dec 13, 2024
f69cd78
upd
dimaMachina Dec 13, 2024
ce223e3
upd
dimaMachina Dec 13, 2024
6f6f481
upd
dimaMachina Dec 13, 2024
a04d46d
upd
dimaMachina Dec 13, 2024
1be7078
Merge branch 'do-not-bundle-codemirror' into react-compiler
dimaMachina Dec 13, 2024
adf7725
Merge branch 'graphiql-vitest' into react-compiler
dimaMachina Dec 13, 2024
d6f62d4
upd
dimaMachina Dec 13, 2024
3ecae05
upd
dimaMachina Dec 13, 2024
8092f10
upd
dimaMachina Dec 13, 2024
ab2fec8
add
dimaMachina Dec 13, 2024
63bb7b4
upd
dimaMachina Dec 14, 2024
25129f5
upd
dimaMachina Dec 14, 2024
d2fb423
upd
dimaMachina Dec 14, 2024
1968198
upd
dimaMachina Dec 14, 2024
d7e2434
upd
dimaMachina Dec 14, 2024
57348be
upd
dimaMachina Dec 14, 2024
b28be43
upd
dimaMachina Dec 14, 2024
3546a58
upd
dimaMachina Dec 14, 2024
cc537f6
clean up deps
dimaMachina Dec 14, 2024
4031182
clean up deps
dimaMachina Dec 14, 2024
1878a0b
clean up deps
dimaMachina Dec 14, 2024
7453fe4
clean up deps
dimaMachina Dec 14, 2024
63674ed
clean up deps
dimaMachina Dec 14, 2024
dfb7578
upd
dimaMachina Dec 14, 2024
4993c1c
upd
dimaMachina Dec 14, 2024
12cd0b6
more changes from graphiql v4
dimaMachina Dec 14, 2024
1b91371
more
dimaMachina Dec 14, 2024
2f829f8
fix path isn't exported
dimaMachina Dec 14, 2024
4a23084
fix integration tests
dimaMachina Dec 14, 2024
6e95096
fix e2e
dimaMachina Dec 14, 2024
948fef0
bump
dimaMachina Dec 14, 2024
8c34ceb
add changeset
dimaMachina Dec 14, 2024
8410fed
remove unneeded beforeDevServer.js
dimaMachina Dec 14, 2024
d89dc49
found case which was not optimized
dimaMachina Dec 14, 2024
346a936
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
460b51e
Delete .changeset/sour-onions-rhyme.md
dimaMachina Dec 14, 2024
42f65cc
Delete .changeset/silly-nails-double.md
dimaMachina Dec 14, 2024
65778d2
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
d4d9062
polish graphiql tests setup
dimaMachina Dec 14, 2024
107e0b6
polish graphiql tests setup
dimaMachina Dec 14, 2024
8cc4fcf
Merge branch 'main' into react-compiler2
dimaMachina Dec 14, 2024
e0949ac
should be good
dimaMachina Dec 14, 2024
ad75cda
prettier
dimaMachina Dec 14, 2024
bdd41ba
upd
dimaMachina Dec 25, 2024
fd8411b
Merge branch 'main' into react-compiler2
dimaMachina Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stupid-lamps-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphiql': minor
---

migrate `graphiql` to `vite` and `react compiler`
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ module.exports = {
},
},
{
files: ['packages/graphiql-react/**'],
files: ['packages/{graphiql-react,graphiql}/**'],
plugins: ['react-compiler'],
rules: {
'@typescript-eslint/no-restricted-imports': [
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ packages/codemirror-graphql/*.d.ts
packages/codemirror-graphql/*.map
!packages/codemirror-graphql/*.config.js

packages/graphiql/index.html
packages/graphiql/dev.html
packages/graphiql/analyzer.html
packages/graphiql/graphiql*.js
packages/graphiql/*.css
packages/graphiql/*.map
packages/graphiql/cypress/screenshots/
packages/graphiql/typedoc/
packages/graphiql/webpack/
2 changes: 2 additions & 0 deletions examples/monaco-graphql-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
"cross-env": "^7.0.2",
"css-loader": "^6.7.3",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "7.3.0",
"html-webpack-plugin": "^5.5.0",
"monaco-editor-webpack-plugin": "^7.0.1",
"style-loader": "^3.3.1",
"typescript": "^4.6.3",
"webpack": "5.76.0",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"scripts": {
"build": "yarn build-clean && yarn tsc && yarn build:nontsc",
"build-bundles": "yarn prebuild-bundles && yarn wsrun:noexamples --stages build-bundles",
"build-bundles-clean": "rimraf '{packages,examples,plugins}/**/{bundle,cdn,webpack}' && yarn workspace graphiql build-bundles-clean",
"build-bundles-clean": "rimraf '{packages,examples}/**/{bundle,cdn,webpack}'",
"build-clean": "yarn tsc --clean",
"build-docs": "rimraf packages/graphiql/typedoc && typedoc packages",
"build:nontsc": "yarn wsrun:noexamples --exclude-missing --serial build",
Expand All @@ -46,8 +46,7 @@
"check": "yarn tsc --noEmit",
"cypress-open": "yarn workspace graphiql cypress-open",
"dev-graphiql": "yarn workspace graphiql dev",
"e2e": "yarn run e2e:build && yarn workspace graphiql e2e",
"e2e:build": "WEBPACK_SERVE=1 yarn workspace graphiql build-bundles",
"e2e": "yarn workspace graphiql e2e",
"eslint": "NODE_OPTIONS=--max-old-space-size=4096 ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ignore-path .gitignore --cache .",
"format": "yarn eslint --fix && yarn pretty",
"jest": "jest",
Expand Down Expand Up @@ -106,14 +105,15 @@
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"babel-jest": "^29.4.3",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"concurrently": "^7.0.0",
"copy": "^0.3.2",
"cspell": "^5.15.2",
"eslint": "9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-cypress": "^3.4.0",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-mdx": "^3.1.5",
Expand All @@ -124,6 +124,7 @@
"eslint-plugin-sonarjs": "^1.0.4",
"eslint-plugin-unicorn": "^55.0.0",
"execa": "^7.1.1",
"identity-obj-proxy": "^3.0.0",
"fetch-mock": "6.5.2",
"husky": "^4.2.3",
"jest": "^27.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@

### Patch Changes

- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unecessary renders by using useMemo or useCallback
- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unnecessary renders by using useMemo or useCallback

- Updated dependencies [[`911cf3e0`](https://github.com/graphql/graphiql/commit/911cf3e0b0fa13268245463c8db8299279e5c461), [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f), [`2ca4841b`](https://github.com/graphql/graphiql/commit/2ca4841baf74e87a3f067b3415f8da3347ee3898), [`7bf90929`](https://github.com/graphql/graphiql/commit/7bf90929f62ba812c0946e0424f9f843f7b6b0ff), [`431b7fe1`](https://github.com/graphql/graphiql/commit/431b7fe1efefa4867f0ea617adc436b1117052e8)]:
- @graphiql/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@

- [#3194](https://github.com/graphql/graphiql/pull/3194) [`911cf3e0`](https://github.com/graphql/graphiql/commit/911cf3e0b0fa13268245463c8db8299279e5c461) Thanks [@dwwoelfel](https://github.com/dwwoelfel)! - fix tab content getting replaced on `changeTab`

- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unecessary renders by using useMemo or useCallback
- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unnecessary renders by using useMemo or useCallback

- [#3197](https://github.com/graphql/graphiql/pull/3197) [`2ca4841b`](https://github.com/graphql/graphiql/commit/2ca4841baf74e87a3f067b3415f8da3347ee3898) Thanks [@B2o5T](https://github.com/B2o5T)! - remove confusing ligatures, set `font-variant-ligatures: none`

Expand Down
1 change: 0 additions & 1 deletion packages/graphiql/.babelrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/graphiql/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@

### Patch Changes

- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unecessary renders by using useMemo or useCallback
- [#3124](https://github.com/graphql/graphiql/pull/3124) [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f) Thanks [@B2o5T](https://github.com/B2o5T)! - avoid unnecessary renders by using useMemo or useCallback

- Updated dependencies [[`911cf3e0`](https://github.com/graphql/graphiql/commit/911cf3e0b0fa13268245463c8db8299279e5c461), [`c645932c`](https://github.com/graphql/graphiql/commit/c645932c7973e11ad917e1d1d897fd409f8c042f), [`2ca4841b`](https://github.com/graphql/graphiql/commit/2ca4841baf74e87a3f067b3415f8da3347ee3898), [`7bf90929`](https://github.com/graphql/graphiql/commit/7bf90929f62ba812c0946e0424f9f843f7b6b0ff), [`431b7fe1`](https://github.com/graphql/graphiql/commit/431b7fe1efefa4867f0ea617adc436b1117052e8)]:
- @graphiql/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions packages/graphiql/__mocks__/codemirror.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// @ts-nocheck
'use no memo';

function CodeMirror(node: HTMLElement, { value, ...options }) {
let _eventListeners = {};
const mockWrapper = document.createElement('div');
Expand Down
1 change: 0 additions & 1 deletion packages/graphiql/babel.config.js

This file was deleted.

4 changes: 3 additions & 1 deletion packages/graphiql/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineConfig } from 'cypress';

const PORT = process.env.CI === 'true' ? 8080 : 5173;

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:8080',
baseUrl: `http://localhost:${PORT}`,
},
video: false,
viewportWidth: 1920,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/cypress/e2e/init.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const mockSuccess = {
data: {
longDescriptionType: {
id: 'abc123',
image: '/images/logo.svg',
image: '/resources/logo.svg',
hasArgs: '{"defaultValue":"test default value"}',
test: {
id: 'abc123',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql/cypress/e2e/tabs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Tabs', () => {
query: 'query Foo {image}',
variablesString: '{"someVar":42}',
headersString: '{"someHeader":"someValue"}',
response: { data: { image: '/images/logo.svg' } },
response: { data: { image: '/resources/logo.svg' } },
});

// Close tab
Expand Down
1 change: 1 addition & 0 deletions packages/graphiql/cypress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-expect-error -- fixme
export default (on, config) => {
return config;
};
5 changes: 5 additions & 0 deletions packages/graphiql/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,27 @@ declare namespace Cypress {
}
}

// @ts-expect-error -- fixme
Cypress.Commands.add('dataCy', value => {
return cy.get(`[data-cy="${value}"]`);
});

// @ts-expect-error -- fixme
Cypress.Commands.add('clickExecuteQuery', () => {
return cy.get('.graphiql-execute-button').click();
});

// @ts-expect-error -- fixme
Cypress.Commands.add('clickPrettify', () => {
return cy.get('[aria-label="Prettify query (Shift-Ctrl-P)"]').click();
});

// @ts-expect-error -- fixme
Cypress.Commands.add('visitWithOp', ({ query, variables, variablesString }) => {
let url = `/?query=${encodeURIComponent(query)}`;
if (variables || variablesString) {
url += `&variables=${encodeURIComponent(
// @ts-expect-error -- fixme
JSON.stringify(variables, null, 2) || variablesString,
)}`;
}
Expand Down
45 changes: 45 additions & 0 deletions packages/graphiql/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/resources/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GraphiQL</title>
<style>
body {
margin: 0;
overflow: hidden; /* in Firefox */
}

#graphiql {
height: 100dvh;
}

.loading {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 4rem;
}
</style>
<!--vite-replace-start-->
<script
crossorigin
src="https://unpkg.com/react@18/umd/react.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
></script>
<script src="/dist/index.umd.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

this should be graphiql.js or else it will break all the unpkg implementations

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what do you mean by it will break all the unpkg implementations?

/dist/index.umd.js === /graphql.js
/dist/index.umd.js === /graphql.min.js

<link href="/dist/style.css" rel="stylesheet" />
<!--vite-replace-end-->
</head>
<body>
<div id="graphiql">
<div class="loading">Loading…</div>
</div>
<script type="module" src="resources/renderExample.js"></script>
</body>
</html>
62 changes: 25 additions & 37 deletions packages/graphiql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,39 @@
},
"license": "MIT",
"main": "dist/index.js",
"module": "esm/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
"esm",
"src",
"graphiql.js",
"graphiql.min.js",
"graphiql.min.js.map",
"graphiql.css",
"graphiql.min.css",
"graphiql.min.css.map"
"graphiql.min.css"
],
"exports": {
"./package.json": "./package.json",
"./style.css": "./dist/style.css",
"./graphiql.css": "./dist/style.css",
Copy link
Member

@acao acao Dec 14, 2024

Choose a reason for hiding this comment

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

exports don't work with jsdelivr/unpkg unfortunately, we must publish to npm with these exact files

Copy link
Collaborator Author

@dimaMachina dimaMachina Dec 15, 2024

Choose a reason for hiding this comment

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

this is for backward compatibility since I added exports field

I added prepublishOnly with the exact files

"prepublishOnly": "cp dist/index.umd.js graphiql.js && cp dist/index.umd.js.map graphiql.js.map && cp dist/index.umd.js graphiql.min.js && cp dist/index.umd.js.map graphiql.min.js.map && cp dist/style.css graphiql.css && cp dist/style.css graphiql.min.css",

".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"analyze-bundle": "cross-env NODE_ENV=production ANALYZE=1 yarn webpack -p",
"build": "yarn build-clean && yarn build-cjs && yarn build-esm",
"build-bundles": "yarn build-bundles-clean && yarn build-bundles-webpack",
"build-bundles-clean": "rimraf 'graphiql.*{js,css}' *.html",
"build-bundles-webpack": "cross-env yarn webpack --mode development --bail",
"build-cjs": "tsc",
"build-clean": "rimraf esm dist webpack *.html",
"build-esm": "tsc --project ./tsconfig.esm.json",
"check": "tsc --noEmit",
"cypress-open": "yarn e2e-server 'cypress open'",
"dev": "cross-env NODE_ENV=development webpack-dev-server --config resources/webpack.config.js",
"prebuild": "yarn types:check",
"types:check": "tsc --noEmit",
"build": "vite build && UMD=true vite build",
"cypress-open": "yarn dev 'cypress open'",
"dev": "concurrently 'cross-env PORT=8080 node test/e2e-server' vite",
"e2e": "yarn e2e-server 'cypress run'",
"e2e-server": "start-server-and-test 'cross-env PORT=8080 node test/e2e-server' 'http-get://localhost:8080/graphql?query={test { id }}'",
"webpack": "webpack-cli --config resources/webpack.config.js",
"prepublishOnly": "cp dist/index.umd.js graphiql.js && cp dist/index.umd.js.map graphiql.js.map && cp dist/index.umd.js graphiql.min.js && cp dist/index.umd.js.map graphiql.min.js.map && cp dist/style.css graphiql.css && cp dist/style.css graphiql.min.css",
"test": "vitest"
},
"dependencies": {
"react-compiler-runtime": "19.0.0-beta-37ed2a7-20241206",
"@graphiql/react": "^0.28.0"
},
"peerDependencies": {
Expand All @@ -56,42 +58,28 @@
"react-dom": "^16.8.0 || ^17 || ^18"
},
"devDependencies": {
"babel-plugin-react-compiler": "19.0.0-beta-37ed2a7-20241206",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-commonjs": "^0.10.4",
"vite": "^5.3.6",
"postcss-lightningcss": "^1.0.1",
"@vitejs/plugin-react": "^4.3.1",
"@graphiql/toolkit": "^0.11.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"babel-loader": "^9.1.2",
"babel-plugin-macros": "^3.1.0",
"cross-env": "^7.0.2",
"css-loader": "^6.7.3",
"cssnano": "^5.1.15",
"cypress": "^13.13.2",
"express": "^4.20.0",
"fork-ts-checker-webpack-plugin": "7.3.0",
"graphql": "^16.9.0",
"graphql-http": "^1.22.1",
"graphql-subscriptions": "^2.0.0",
"html-webpack-plugin": "^5.5.0",
"identity-obj-proxy": "^3.0.0",
"mini-css-extract-plugin": "^2.7.2",
"postcss": "8.4.31",
"postcss-import": "15.1.0",
"postcss-loader": "7.0.2",
"postcss-preset-env": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-loader": "^4.12.20",
"react-test-renderer": "^18.2.0",
"require-context.macro": "^1.2.2",
"rimraf": "^3.0.2",
"serve": "^11.3.0",
"start-server-and-test": "^1.10.11",
"style-loader": "^3.3.1",
"subscriptions-transport-ws": "0.11.0",
"typescript": "^4.6.3",
"webpack": "5.76.0",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1",
"ws": "8.17.1"
}
}
22 changes: 9 additions & 13 deletions packages/graphiql/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
module.exports =
process.env.NODE_ENV === 'test'
? {}
: ({ options, webpackLoaderContext }) => ({
plugins: {
// https://github.com/postcss/postcss-import/issues/442#issuecomment-822427606
'postcss-import': { root: webpackLoaderContext.context },
// contains autoprefixer, etc
'postcss-preset-env': options['postcss-preset-env'] || false,
cssnano:
process.env.NODE_ENV === 'production' ? options.cssnano : false,
},
});
module.exports = {
plugins: {
// https://github.com/postcss/postcss-import/issues/442#issuecomment-822427606
'postcss-import': '',
'postcss-lightningcss': {
browsers: '>= .25%',
},
},
};
Loading
Loading