From 8af9c6576d9d2a9d2d4ff9e863a310000b881848 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 18 Mar 2022 17:24:16 +0100 Subject: build(web/ui): Migrate to next-global-css This change updates the web interface to use next-global-css instead of next-transpile-modules. This approach is more efficient since it does not require transpilation of the dependencies. --- opendc-web/opendc-web-ui/next.config.js | 30 ++++++------------------------ opendc-web/opendc-web-ui/package.json | 2 +- opendc-web/opendc-web-ui/yarn.lock | 31 +++++-------------------------- 3 files changed, 12 insertions(+), 51 deletions(-) (limited to 'opendc-web/opendc-web-ui') diff --git a/opendc-web/opendc-web-ui/next.config.js b/opendc-web/opendc-web-ui/next.config.js index 1dfe4156..ceb0900e 100644 --- a/opendc-web/opendc-web-ui/next.config.js +++ b/opendc-web/opendc-web-ui/next.config.js @@ -22,39 +22,21 @@ // PatternFly 4 uses global CSS imports in its distribution files. Therefore, // we need to transpile the modules before we can use them. -const withTM = require('next-transpile-modules')([ - '@patternfly/react-core', - '@patternfly/react-styles', - '@patternfly/react-table', - '@patternfly/react-tokens', -]) +const { withGlobalCss } = require('next-global-css') +const withConfig = withGlobalCss() -module.exports = withTM({ +module.exports = withConfig({ reactStrictMode: true, experimental: { - eslint: true, + eslint: true }, async redirects() { return [ { source: '/', destination: '/projects', - permanent: true, - }, - ] - }, - webpack: (config, options) => { - if (options.dev) { - config.optimization.splitChunks = { - cacheGroups: { - vendor: { - test: /[\\/]node_modules[\\/]/, - name: 'transpiled-modules', - chunks: 'all', - }, - }, + permanent: true } - } - return config + ] } }) diff --git a/opendc-web/opendc-web-ui/package.json b/opendc-web/opendc-web-ui/package.json index 29065bc4..87ab25fb 100644 --- a/opendc-web/opendc-web-ui/package.json +++ b/opendc-web/opendc-web-ui/package.json @@ -35,7 +35,7 @@ "lint-staged": "^10.5.4", "mathjs": "^7.6.0", "next": "^12.1.0", - "next-transpile-modules": "^8.0.0", + "next-global-css": "^1.3.0", "normalizr": "^3.6.1", "prettier": "^2.3.2", "prop-types": "^15.7.2", diff --git a/opendc-web/opendc-web-ui/yarn.lock b/opendc-web/opendc-web-ui/yarn.lock index 06073b95..c995315b 100644 --- a/opendc-web/opendc-web-ui/yarn.lock +++ b/opendc-web/opendc-web-ui/yarn.lock @@ -1072,14 +1072,6 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^5.7.0: - version "5.8.2" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b" - integrity sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - enquirer@^2.3.5, enquirer@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" @@ -1131,11 +1123,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - escape-latex@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/escape-latex/-/escape-latex-1.2.0.tgz#07c03818cf7dac250cce517f4fda1b001ef2bca1" @@ -1584,7 +1571,7 @@ globby@^11.0.3: merge2 "^1.3.0" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.2.4: +graceful-fs@^4.1.2: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== @@ -2151,13 +2138,10 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -next-transpile-modules@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/next-transpile-modules/-/next-transpile-modules-8.0.0.tgz#56375cdc25ae5d23a834195f277fc2737b26cb97" - integrity sha512-Q2f2yB0zMJ8KJbIYAeZoIxG6cSfVk813zr6B5HzsLMBVcJ3FaF8lKr7WG66n0KlHCwjLSmf/6EkgI6QQVWHrDw== - dependencies: - enhanced-resolve "^5.7.0" - escalade "^3.1.1" +next-global-css@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/next-global-css/-/next-global-css-1.3.0.tgz#6172c15fbdd921621c794f3864e01a27ad693bbb" + integrity sha512-1+eOZ5aNPpG3qthJ16EKUEu4Ba8asa3WKBH/aTsKWQiybbZsJXhwyqHb1PLnsUrCi2xHIkK8BdRaHkvWP7NG4Q== next@^12.1.0: version "12.1.0" @@ -3063,11 +3047,6 @@ table@^6.0.9: string-width "^4.2.0" strip-ansi "^6.0.0" -tapable@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b" - integrity sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw== - text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -- cgit v1.2.3