Skip to content

Commit

Permalink
Chore/app 2180 build (#838)
Browse files Browse the repository at this point in the history
* Tidy package.json change chunking

* shrink users.tsx

* adjust svg position users.tsx

* add  uglify

* Add in tooling to allow serving with brotli compression like production

* Add purge to tailwind, add license, changelog

* resolve conflicts yarn.lock

* add  uglify

* Add purge to tailwind, add license, changelog

* regen yarn.lock
  • Loading branch information
jamesej authored May 16, 2023
1 parent e83fbbe commit 0b86bb9
Show file tree
Hide file tree
Showing 11 changed files with 1,184 additions and 1,427 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ coverage

# production
build
build.txt
dist
dist-ssr
*.local
Expand Down
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-uglify": "^6.0.4",
"size-limit": "^6.0.4",
"styled-components": "^5.3.3",
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
Expand Down

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/ui-components/tsdx.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const images = require('@rollup/plugin-image');
const postcss = require('rollup-plugin-postcss');
const replace = require('@rollup/plugin-replace');
const { uglify } = require('rollup-plugin-uglify');

module.exports = {
rollup(config, opts) {
Expand Down Expand Up @@ -33,6 +34,9 @@ module.exports = {
images({include: ['**/*.png', '**/*.jpg', '**/*.svg']}),
...config.plugins,
];

config.plugins.push(uglify());

return config;
},
};
22 changes: 22 additions & 0 deletions packages/web-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Aragon App Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.13] - 2023-03-05

### Added


### Fixed

- Improve French translation (#377).

### Changed


### Removed
9 changes: 9 additions & 0 deletions packages/web-app/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
https://app.local {
handle /* {
root * dist
file_server {
precompressed br gzip
}
try_files {path} /index.html
}
}
15 changes: 9 additions & 6 deletions packages/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
"author": "Aragon Association",
"scripts": {
"dev": "vite",
"build": "tsc && vite build --sourcemap true",
"build": "tsc && cross-env NODE_ENV=production node --max_old_space_size=16384 ../../node_modules/vite/bin/vite.js build --sourcemap true > build.txt",
"serve": "vite preview",
"prepbrotli": "brotli-cli compress --glob \"dist/assets/*.*\"",
"servebrotli": "caddy run",
"serve:docker": "vite --host --port 5000",
"test": "jest --coverage=false",
"lint": "eslint src --max-warnings=0 && yarn check-types",
Expand All @@ -24,17 +26,13 @@
"@ledgerhq/connect-kit-loader": "^1.0.2",
"@radix-ui/react-accordion": "^0.1.6",
"@rollup/plugin-typescript": "^8.3.0",
"@synthetixio/synpress": "^3.0.5",
"@tailwindcss/line-clamp": "^0.4.0",
"@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.26.1",
"@tiptap/extension-link": "^2.0.0-beta.35",
"@tiptap/react": "^2.0.0-beta.104",
"@tiptap/starter-kit": "^2.0.0-beta.168",
"@types/graphql": "^14.5.0",
"@types/react-router-dom": "^5.3.2",
"@walletconnect/web3-provider": "^1.8.0",
"apollo": "^2.33.10",
"apollo-link-rest": "^0.9.0-rc.1",
"apollo3-cache-persist": "^0.14.0",
"big.js": "^6.2.1",
Expand Down Expand Up @@ -65,10 +63,12 @@
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@synthetixio/synpress": "^3.5.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@typechain/ethers-v5": "^9.0.0",
"@types/big.js": "^6.1.5",
"@types/graphql": "^14.5.0",
"@types/jest": "^26.0.24",
"@types/node": "^16.18.11",
"@types/react": "^17.0.14",
Expand All @@ -82,6 +82,7 @@
"autoprefixer": "^10.3.1",
"babel-jest": "^27.0.6",
"babel-preset-vite": "^1.0.4",
"cross-env": "^7.0.3",
"cypress": "^12.3.0",
"env-cmd": "^10.1.0",
"eslint": "^7.30.0",
Expand All @@ -94,7 +95,9 @@
"postcss": "^8.3.5",
"prettier": "2.3.2",
"react-test-renderer": "^17.0.2",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-polyfill-node": "^0.12.0",
"rollup-plugin-uglify": "^6.0.4",
"tailwindcss": "^2.2.4",
"typescript": "^4.3.5",
"vite": "^2.9.13",
Expand All @@ -104,4 +107,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/web-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
purge: false, // purge: ['./src/**/*.html', './src/**/*.tsx'], TODO: investigate
purge: ['./src/**/*.html', './src/**/*.tsx', '../ui-components/src/**/*.tsx'],
darkMode: false,
theme: {
extend: {
Expand Down
22 changes: 22 additions & 0 deletions packages/web-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import tsconfigPaths from 'vite-tsconfig-paths';
import {defineConfig, loadEnv} from 'vite';
import {resolve} from 'path';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import analyze from 'rollup-plugin-analyzer';
import {uglify} from 'rollup-plugin-uglify';

import {uglify} from 'rollup-plugin-uglify';

const production = process.env.NODE_ENV === 'production';

// https://vitejs.dev/config/
Expand Down Expand Up @@ -46,8 +51,25 @@ export default defineConfig(({mode}) => {
plugins: [
// ↓ Needed for build
nodePolyfills(),
analyze({
stdout: true,
summaryOnly: true,
}),
production && uglify(),
],
output: {
manualChunks: {
'osx-ethers': ['@aragon/osx-ethers'],
tiptap: [
'@tiptap/extension-link',
'@tiptap/extension-placeholder',
'@tiptap/react',
'@tiptap/starter-kit',
],
},
},
},
// minify: false,
// ↓ Needed for build if using WalletConnect and other providers
commonjsOptions: {
transformMixedEsModules: true,
Expand Down
Loading

0 comments on commit 0b86bb9

Please sign in to comment.