Merge pull request #8325 from backstage/vinzscam/bump-esbuild-and-rollup
Add cli option for minifying plugins and backend build
This commit is contained in:
@@ -38,9 +38,9 @@
|
||||
"@lerna/project": "^4.0.0",
|
||||
"@octokit/request": "^5.4.12",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-json": "^4.0.2",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.0",
|
||||
"@rollup/plugin-yaml": "^3.0.0",
|
||||
"@rollup/plugin-yaml": "^3.1.0",
|
||||
"@spotify/eslint-config-base": "^12.0.0",
|
||||
"@spotify/eslint-config-react": "^12.0.0",
|
||||
"@spotify/eslint-config-typescript": "^12.0.0",
|
||||
@@ -62,7 +62,7 @@
|
||||
"css-loader": "^5.2.6",
|
||||
"dashify": "^2.0.0",
|
||||
"diff": "^5.0.0",
|
||||
"esbuild": "^0.8.56",
|
||||
"esbuild": "^0.14.1",
|
||||
"eslint": "^7.30.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-formatter-friendly": "^7.0.0",
|
||||
@@ -94,9 +94,9 @@
|
||||
"react-hot-loader": "^4.12.21",
|
||||
"recursive-readdir": "^2.2.2",
|
||||
"replace-in-file": "^6.0.0",
|
||||
"rollup": "2.44.x",
|
||||
"rollup-plugin-dts": "^3.0.1",
|
||||
"rollup-plugin-esbuild": "2.6.x",
|
||||
"rollup": "^2.60.2",
|
||||
"rollup-plugin-dts": "^4.0.1",
|
||||
"rollup-plugin-esbuild": "^4.7.2",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.2",
|
||||
"rollup-plugin-postcss": "^4.0.0",
|
||||
"rollup-pluginutils": "^2.8.2",
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Command } from 'commander';
|
||||
import { buildPackage, Output } from '../../lib/builder';
|
||||
|
||||
export default async () => {
|
||||
export default async (cmd: Command) => {
|
||||
await buildPackage({
|
||||
outputs: new Set([Output.cjs, Output.types]),
|
||||
minify: cmd.minify,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,6 +47,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
program
|
||||
.command('backend:build')
|
||||
.description('Build a backend plugin')
|
||||
.option('--minify', 'Minify the generated code')
|
||||
.action(lazy(() => import('./backend/build').then(m => m.default)));
|
||||
|
||||
program
|
||||
@@ -116,6 +117,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
program
|
||||
.command('plugin:build')
|
||||
.description('Build a plugin')
|
||||
.option('--minify', 'Minify the generated code')
|
||||
.action(lazy(() => import('./plugin/build').then(m => m.default)));
|
||||
|
||||
program
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Command } from 'commander';
|
||||
import { buildPackage, Output } from '../../lib/builder';
|
||||
|
||||
export default async () => {
|
||||
export default async (cmd: Command) => {
|
||||
await buildPackage({
|
||||
outputs: new Set([Output.esm, Output.types]),
|
||||
minify: cmd.minify,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -100,6 +100,7 @@ export const makeConfigs = async (
|
||||
}),
|
||||
esbuild({
|
||||
target: 'es2019',
|
||||
minify: options.minify,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -22,4 +22,5 @@ export enum Output {
|
||||
|
||||
export type BuildOptions = {
|
||||
outputs: Set<Output>;
|
||||
minify?: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user