Skip to content

Commit

Permalink
fix: set minify to false by default - according to Alfred communi…
Browse files Browse the repository at this point in the history
…ty guildlines 🚀
  • Loading branch information
Avivbens committed Jun 14, 2024
1 parent ea02f0e commit 57e5007
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
11 changes: 8 additions & 3 deletions docs/app/setup/bundler-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,13 @@ module.exports = {

## `minify`

By default, `fast-alfred` would minify the output files.
It might be useful to disable this feature for debugging purposes.
By default, `fast-alfred` would not minify the output files.
It might be useful to enable this option if you want to reduce the bundle size.

::: tip TIP :zap:
By official Alfred documentation, you should not minify the output files, so users would be able to read the code.
See more details [in here](https://alfred.app/security-and-privacy/#signed-binaries).
:::

##### Example

Expand All @@ -160,7 +165,7 @@ It might be useful to disable this feature for debugging purposes.
*/
module.exports = {
bundlerOptions: {
minify: false, // Disable minification
minify: true, // Enable minification
},
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/bundler/constants/bundler-options-defaults.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const BUNDLER_DEFAULTS: Required<BundlerOptions> = {
targetDir: 'esbuild',
productionScripts: ['src/main/*.ts'],
esmHelpers: false,
minify: true,
minify: false,
treeShaking: true,
outputFormat: 'cjs',
overrideEsbuildOptions: {},
Expand Down
5 changes: 4 additions & 1 deletion src/bundler/models/bundler-options.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ export interface BundlerOptions {
* Whether to minify the output.
* Should reduce file size, but prevent proper debugging.
*
* @default true
* @note
* According to [Alfred's documentation](https://alfred.app/security-and-privacy/#signed-binaries), this option is not recommended.
*
* @default false
*/
minify?: boolean

Expand Down

0 comments on commit 57e5007

Please sign in to comment.