mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 02:41:23 +08:00
Optimize bundle dependency size (#1449)
This commit is contained in:
parent
fab1c62fde
commit
2f65f6cec0
@ -1,138 +0,0 @@
|
||||
module.exports = {
|
||||
productName: 'Mark Text',
|
||||
appId: 'com.github.marktext.marktext',
|
||||
asar: true,
|
||||
asarUnpack: [
|
||||
'**/*.node'
|
||||
],
|
||||
directories: {
|
||||
'output': 'build'
|
||||
},
|
||||
fileAssociations: [
|
||||
{
|
||||
ext: [
|
||||
'md',
|
||||
'markdown',
|
||||
'mmd',
|
||||
'mdown',
|
||||
'mdtxt',
|
||||
'mdtext'
|
||||
],
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document',
|
||||
role: 'Editor',
|
||||
icon: '../resources/icons/md.icns'
|
||||
}
|
||||
],
|
||||
files: [
|
||||
'dist/electron/**/*'
|
||||
],
|
||||
extraFiles: [
|
||||
'LICENSE',
|
||||
{
|
||||
from: 'resources/THIRD-PARTY-LICENSES.txt',
|
||||
to: 'THIRD-PARTY-LICENSES.txt'
|
||||
}
|
||||
],
|
||||
dmg: {
|
||||
artifactName: 'marktext-${version}.${ext}',
|
||||
contents: [
|
||||
{
|
||||
x: 410,
|
||||
y: 150,
|
||||
type: 'link',
|
||||
path: '/Applications'
|
||||
},
|
||||
{
|
||||
x: 130,
|
||||
y: 150,
|
||||
type: 'file'
|
||||
}
|
||||
]
|
||||
},
|
||||
mac: {
|
||||
artifactName: 'marktext-${version}-mac.${ext}',
|
||||
icon: 'resources/icons/icon.icns',
|
||||
darkModeSupport: true
|
||||
},
|
||||
win: {
|
||||
artifactName: 'marktext-${version}-${arch}-win.${ext}',
|
||||
icon: 'resources/icons/icon.ico',
|
||||
target: [
|
||||
{
|
||||
target: 'nsis',
|
||||
arch: [
|
||||
'ia32',
|
||||
'x64'
|
||||
]
|
||||
},
|
||||
{
|
||||
target: 'zip',
|
||||
arch: [
|
||||
'ia32',
|
||||
'x64'
|
||||
]
|
||||
}
|
||||
],
|
||||
requestedExecutionLevel: 'asInvoker'
|
||||
},
|
||||
nsis: {
|
||||
artifactName: 'marktext-setup-${version}.${ext}',
|
||||
perMachine: false,
|
||||
oneClick: false,
|
||||
allowToChangeInstallationDirectory: true,
|
||||
include: 'resources/windows/installer.nsh'
|
||||
},
|
||||
linux: {
|
||||
artifactName: 'marktext-${version}-${arch}.${ext}',
|
||||
category: 'Office;TextEditor;Utility',
|
||||
mimeTypes: [
|
||||
'text/markdown'
|
||||
],
|
||||
icon: 'resources/icons',
|
||||
desktop: {
|
||||
StartupWMClass: 'marktext',
|
||||
Keywords: 'marktext;'
|
||||
},
|
||||
target: [
|
||||
{
|
||||
target: 'AppImage'
|
||||
},
|
||||
{
|
||||
target: 'tar.gz'
|
||||
}
|
||||
],
|
||||
fileAssociations: [
|
||||
{
|
||||
ext: 'md',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
},
|
||||
{
|
||||
ext: 'markdown',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
},
|
||||
{
|
||||
ext: 'mmd',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
},
|
||||
{
|
||||
ext: 'mdown',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
},
|
||||
{
|
||||
ext: 'mdtxt',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
},
|
||||
{
|
||||
ext: 'mdtext',
|
||||
name: 'Markdown',
|
||||
description: 'Markdown document'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
105
electron-builder.yml
Normal file
105
electron-builder.yml
Normal file
@ -0,0 +1,105 @@
|
||||
productName: "Mark Text"
|
||||
appId: "com.github.marktext.marktext"
|
||||
|
||||
asar: true
|
||||
asarUnpack:
|
||||
- "**/*.node"
|
||||
directories:
|
||||
output: "build"
|
||||
files:
|
||||
- "dist/electron/**/*"
|
||||
# Don't bundle these files
|
||||
- "!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}"
|
||||
- "!node_modules/css-b64-images/{draft.png,draft.xcf}"
|
||||
- "!node_modules/dagre-d3-renderer/dist/{dagre-d3.js.map,demo/}"
|
||||
- "!node_modules/dagre-layout/dist/dagre-layout*.js.map"
|
||||
- "!node_modules/dragula/resources"
|
||||
- "!node_modules/mermaid/dist/mermaid*.js.map"
|
||||
- "!node_modules/terser/dist/bundle.min.js.map"
|
||||
- "!node_modules/vega-lite/build/vega-lite*.js.map"
|
||||
# Don't bundle build files
|
||||
- "!node_modules/fontmanager-redux/bin"
|
||||
- "!node_modules/keyboard-layout/bin"
|
||||
- "!node_modules/keytar/bin"
|
||||
- "!node_modules/vscode-windows-registry/bin"
|
||||
extraFiles:
|
||||
- "LICENSE"
|
||||
- from: "resources/THIRD-PARTY-LICENSES.txt"
|
||||
to: "THIRD-PARTY-LICENSES.txt"
|
||||
|
||||
fileAssociations:
|
||||
- ext:
|
||||
- "md"
|
||||
- "markdown"
|
||||
- "mmd"
|
||||
- "mdown"
|
||||
- "mdtxt"
|
||||
- "mdtext"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
role: "Editor"
|
||||
icon: "../resources/icons/md.icns"
|
||||
dmg:
|
||||
artifactName: "marktext-${version}.${ext}"
|
||||
contents:
|
||||
- x: 410
|
||||
y: 150
|
||||
type: "link"
|
||||
path: "/Applications"
|
||||
- x: 130
|
||||
y: 150
|
||||
type: "file"
|
||||
mac:
|
||||
artifactName: "marktext-${version}-mac.${ext}"
|
||||
icon: "resources/icons/icon.icns"
|
||||
darkModeSupport: true
|
||||
win:
|
||||
artifactName: "marktext-${version}-${arch}-win.${ext}"
|
||||
icon: "resources/icons/icon.ico"
|
||||
target:
|
||||
- target: "nsis"
|
||||
arch:
|
||||
- "ia32"
|
||||
- "x64"
|
||||
- target: "zip"
|
||||
arch:
|
||||
- "ia32"
|
||||
- "x64"
|
||||
requestedExecutionLevel: "asInvoker"
|
||||
nsis:
|
||||
artifactName: "marktext-setup-${version}.${ext}"
|
||||
perMachine: false
|
||||
oneClick: false
|
||||
allowToChangeInstallationDirectory: true
|
||||
include: "resources/windows/installer.nsh"
|
||||
linux:
|
||||
artifactName: "marktext-${version}-${arch}.${ext}"
|
||||
category: "Office;TextEditor;Utility"
|
||||
mimeTypes:
|
||||
- "text/markdown"
|
||||
icon: "resources/icons"
|
||||
desktop:
|
||||
StartupWMClass: "marktext"
|
||||
Keywords: "marktext;"
|
||||
target:
|
||||
- target: "AppImage"
|
||||
- target: "tar.gz"
|
||||
fileAssociations:
|
||||
- ext: "md"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
- ext: "markdown"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
- ext: "mmd"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
- ext: "mdown"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
- ext: "mdtxt"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
||||
- ext: "mdtext"
|
||||
name: "Markdown"
|
||||
description: "Markdown document"
|
Loading…
Reference in New Issue
Block a user