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

Build performance #1185

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ result
!.yarn/releases
!.yarn/sdks
!.yarn/versions

.tsbuildinfo
2 changes: 1 addition & 1 deletion apps/browser-extension-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"license": "Apache-2.0",
"author": "IOHK",
"main": "dist/index.js",
"main": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"directories": {
"lib": "src",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"apps/*"
],
"scripts": {
"base-command-for-build-scripts": "wsrun --prefix -trame ${APP_NAME:+-p \"@lace/$APP_NAME\"} ${EXCLUDE_APP:+-x \"@lace/$APP_NAME\"} ${EXCLUDE_BROWSER:+-x \"@lace/browser-extension-wallet\"}",
"base-command-for-build-scripts": "wsrun --prefix -srame ${APP_NAME:+-p \"@lace/$APP_NAME\"} ${EXCLUDE_APP:+-x \"@lace/$APP_NAME\"} ${EXCLUDE_BROWSER:+-x \"@lace/browser-extension-wallet\"}",
"browser": "APP_NAME=browser-extension-wallet yarn $0",
"build": "yarn base-command-for-build-scripts -c build",
"build-deps": "EXCLUDE_APP=true yarn build",
Expand Down
1 change: 0 additions & 1 deletion packages/cardano/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"license": "Apache-2.0",
"author": "IOHK",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"directories": {
"lib": "src",
Expand Down
7 changes: 1 addition & 6 deletions packages/cardano/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ export default (args) => {
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true
sourcemap: false
}
]
};
Expand Down
1 change: 0 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"license": "Apache-2.0",
"author": "IOHK",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"directories": {
"lib": "src",
Expand Down
7 changes: 1 addition & 6 deletions packages/common/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ export default (args) => {
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true
sourcemap: false
}
]
};
Expand Down
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"license": "Apache-2.0",
"author": "IOHK",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"directories": {
"lib": "src",
Expand Down
7 changes: 1 addition & 6 deletions packages/core/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ export default (args) => {
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true
sourcemap: false
}
],
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions packages/staking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"license": "Apache-2.0",
"author": "IOHK",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -21,8 +22,7 @@
"default": "./dist/index.css"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
Expand Down
10 changes: 7 additions & 3 deletions packages/staking/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"allowJs": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"baseUrl": "./src",
"incremental": true,
"module": "esnext",
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"module": "es2020",
"target": "es2016",
"preserveConstEnums": true,
"baseUrl": "./src"
"skipLibCheck": true,
"target": "ES2018",
"tsBuildInfoFile": ".tsbuildinfo"
},
"exclude": ["node_modules", "dist"],
"references": [{ "path": "../../packages/core/src" }, { "path": "../../packages/cardano/src" }]
}
4 changes: 2 additions & 2 deletions packages/staking/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const tsupConfig = defineConfig([
},
entry: ['./src/index.ts'],
esbuildPlugins: [
vanillaExtractPlugin({ esbuildOptions: { loader: { '.css': 'empty' } } }),
vanillaExtractPlugin({ esbuildOptions: { loader: { '.css': 'empty' } }, identifiers: 'short' }),
// eslint-disable-next-line new-cap
ScssModulesPlugin() as never,
svgr({ icon: true, plugins: [svgrJsx] }),
],
external: Object.keys(peerDependencies),
format: ['esm', 'cjs'],
format: ['esm'],
loader: {
'.png': 'dataurl',
},
Expand Down
7 changes: 1 addition & 6 deletions packages/translation/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ export default () => ({
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true,
sourcemap: false,
},
],
external: [/node_modules/],
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
"license": "Apache-2.0",
"author": "IOHK",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"scripts": {
"build": "run -T rollup -c rollup.config.js",
"build": "run -T rollup -c rollup.config.js --verbose",
"build-storybook": "NODE_OPTIONS=--openssl-legacy-provider; build-storybook",
"cleanup": "yarn exec rm -rf dist node_modules",
"format": "yarn prettier --write .",
Expand Down
13 changes: 5 additions & 8 deletions packages/ui/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,24 @@ export default () => ({
typescript({
tsconfig: './tsconfig.json',
composite: false,
exclude: ['**/*.stories.tsx'],
exclude: ['node_modules', '**/*.stories.tsx'],
}),
vanillaExtractPlugin({ identifiers: 'short' }),
peerDepsExternal(),
commonjs(),
image(),
svgr({ icon: true }),
vanillaExtractPlugin(),
copy({
copyOnce: true,
hook: 'closeBundle',
targets: [{ src: 'src/assets/icons/*', dest: 'dist/assets/icons' }],
}),
],
output: [
{
file: packageJson.main,
format: 'cjs',
sourcemap: true,
},
{
file: packageJson.module,
format: 'esm',
sourcemap: true,
sourcemap: false,
},
],
external: [/node_modules/],
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export default ({
tsPluginOptions = {
tsconfig: 'src/tsconfig.json',
composite: false,
exclude: ['**/*.stories.tsx', '**/*.test.ts', '**/*.test.tsx']
exclude: ['node_modules', '**/*.stories.tsx', '**/*.test.ts', '**/*.test.tsx']
}
} = {}) => ({
input: 'src/index.ts',
plugins: [
resolve({
preferBuiltins: false,
preferBuiltins: false
}),
typescript(tsPluginOptions),
peerDepsExternal(),
Expand All @@ -26,7 +26,7 @@ export default ({
// no matter what build type it is. It makes cjs build requiring esm version
// https://github.com/egoist/rollup-plugin-postcss/issues/381
// https://github.com/egoist/rollup-plugin-postcss/issues/367
inject: cssVariableName => `
inject: (cssVariableName) => `
import styleInject from 'style-inject';
styleInject(${cssVariableName});`
}),
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"composite": true,
"module": "es2020",
"target": "es2016",
"module": "esnext",
"target": "ES2018",
"jsx": "react",
"allowJs": false,
"moduleResolution": "node",
Expand All @@ -15,7 +15,7 @@
"noUnusedLocals": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
Expand Down
Loading