tmp
This commit is contained in:
8
config/.eslintrc.js
Normal file
8
config/.eslintrc.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
},
|
||||
};
|
||||
11
config/electron-builder.js
Normal file
11
config/electron-builder.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @type {import('electron-builder').Configuration}
|
||||
* @see https://www.electron.build/configuration/configuration
|
||||
*/
|
||||
module.exports = {
|
||||
directories: {
|
||||
output: 'dist/app',
|
||||
buildResources: 'build',
|
||||
app: 'dist/source',
|
||||
},
|
||||
};
|
||||
4
config/electron-vendors.js
Normal file
4
config/electron-vendors.js
Normal file
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
chrome: 85,
|
||||
node: 12,
|
||||
};
|
||||
59
config/external-packages.js
Normal file
59
config/external-packages.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
By default, vite optimizes and packs all the necessary dependencies into your bundle,
|
||||
so there is no need to supply them in your application as a node module.
|
||||
Unfortunately, vite cannot optimize any dependencies:
|
||||
Some that are designed for a node environment may not work correctly after optimization.
|
||||
Therefore, such dependencies should be marked as "external":
|
||||
they will not be optimized, will not be included in your bundle, and will be delivered as a separate node module.
|
||||
*/
|
||||
module.exports.external = [
|
||||
'electron',
|
||||
'electron-updater',
|
||||
];
|
||||
|
||||
|
||||
module.exports.builtins = [
|
||||
'assert',
|
||||
'async_hooks',
|
||||
'buffer',
|
||||
'child_process',
|
||||
'cluster',
|
||||
'console',
|
||||
'constants',
|
||||
'crypto',
|
||||
'dgram',
|
||||
'dns',
|
||||
'domain',
|
||||
'events',
|
||||
'fs',
|
||||
'http',
|
||||
'http2',
|
||||
'https',
|
||||
'inspector',
|
||||
'module',
|
||||
'net',
|
||||
'os',
|
||||
'path',
|
||||
'perf_hooks',
|
||||
'process',
|
||||
'punycode',
|
||||
'querystring',
|
||||
'readline',
|
||||
'repl',
|
||||
'stream',
|
||||
'string_decoder',
|
||||
'timers',
|
||||
'tls',
|
||||
'trace_events',
|
||||
'tty',
|
||||
'url',
|
||||
'util',
|
||||
'v8',
|
||||
'vm',
|
||||
'zlib',
|
||||
];
|
||||
|
||||
module.exports.default = [
|
||||
...module.exports.builtins,
|
||||
...module.exports.external,
|
||||
];
|
||||
37
config/main.vite.js
Normal file
37
config/main.vite.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const {node} = require('./electron-vendors');
|
||||
const {join} = require('path');
|
||||
|
||||
/**
|
||||
* @type {import('vite').UserConfig}
|
||||
* @see https://vitejs.dev/config/
|
||||
*/
|
||||
module.exports = () => {
|
||||
|
||||
return {
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/': join(process.cwd(), './src/main') + '/',
|
||||
},
|
||||
},
|
||||
build: {
|
||||
sourcemap: 'inline',
|
||||
target: `node${node}`,
|
||||
outDir: 'dist/source/main',
|
||||
assetsDir: '.',
|
||||
minify: process.env.MODE === 'development' ? false : 'terser',
|
||||
lib: {
|
||||
entry: 'src/main/index.ts',
|
||||
formats: ['cjs'],
|
||||
},
|
||||
rollupOptions: {
|
||||
external: require('./external-packages').default,
|
||||
output: {
|
||||
entryFileNames: '[name].[format].js',
|
||||
chunkFileNames: '[name].[format].js',
|
||||
assetFileNames: '[name].[ext]',
|
||||
},
|
||||
},
|
||||
emptyOutDir: true,
|
||||
},
|
||||
};
|
||||
};
|
||||
34
config/preload.vite.js
Normal file
34
config/preload.vite.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const {chrome} = require('./electron-vendors');
|
||||
const {join} = require('path');
|
||||
|
||||
/**
|
||||
* @type {import('vite').UserConfig}
|
||||
* @see https://vitejs.dev/config/
|
||||
*/
|
||||
module.exports = {
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/': join(process.cwd(), './src/preload') + '/',
|
||||
},
|
||||
},
|
||||
build: {
|
||||
sourcemap: 'inline',
|
||||
target: `chrome${chrome}`,
|
||||
outDir: 'dist/source/preload',
|
||||
assetsDir: '.',
|
||||
minify: process.env.MODE === 'development' ? false : 'terser',
|
||||
lib: {
|
||||
entry: 'src/preload/index.ts',
|
||||
formats: ['cjs'],
|
||||
},
|
||||
rollupOptions: {
|
||||
external: require('./external-packages').default,
|
||||
output: {
|
||||
entryFileNames: '[name].[format].js',
|
||||
chunkFileNames: '[name].[format].js',
|
||||
assetFileNames: '[name].[ext]',
|
||||
},
|
||||
},
|
||||
emptyOutDir: true,
|
||||
},
|
||||
};
|
||||
29
config/renderer.vite.js
Normal file
29
config/renderer.vite.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const {join} = require('path');
|
||||
const vue = require('@vitejs/plugin-vue');
|
||||
const {chrome} = require('./electron-vendors');
|
||||
/**
|
||||
* @type {import('vite').UserConfig}
|
||||
* @see https://vitejs.dev/config/
|
||||
*/
|
||||
module.exports = {
|
||||
root: join(process.cwd(), './src/renderer'),
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/': join(process.cwd(), './src/renderer') + '/',
|
||||
},
|
||||
},
|
||||
plugins: [vue()],
|
||||
base: '',
|
||||
build: {
|
||||
sourcemap: 'inline',
|
||||
target: `chrome${chrome}`,
|
||||
polyfillDynamicImport: false,
|
||||
outDir: join(process.cwd(), 'dist/source/renderer'),
|
||||
assetsDir: '.',
|
||||
rollupOptions: {
|
||||
external: require('./external-packages').default,
|
||||
},
|
||||
emptyOutDir: true,
|
||||
},
|
||||
};
|
||||
|
||||
18
config/tsconfig-base.json
Normal file
18
config/tsconfig-base.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"sourceMap": true,
|
||||
"moduleResolution": "Node",
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"isolatedModules": true,
|
||||
"types": [
|
||||
"../types/env",
|
||||
"vite/client"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"../**/node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user