🚚 Split 'src' directory into 'src-electron' & 'src-vue' directories

This commit is contained in:
KaKi87 2022-03-02 14:25:10 +01:00
parent 5223acce6e
commit 914aec1a5f
9 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@
Opinionated [Electron](https://github.com/electron/electron) 17.x + [Vue](https://github.com/vuejs/vue) 3.x + [Parcel](https://github.com/parcel-bundler/parcel) 2.x template
![](./src/assets/icon.png)
![](./src-electron/assets/icon.png)
## Specs

View File

@ -10,7 +10,7 @@ process.env['PARCEL_WORKER_BACKEND'] = 'process';
const packageFileLines = fs.readFileSync('./package.json', 'utf8').split('\n');
fs.writeFileSync('./package.json', [...packageFileLines.slice(0, 2), ...packageFileLines.slice(4)].join('\n'));
await new Parcel({
entries: 'src/index.html',
entries: 'src-vue/index.html',
defaultConfig: '@parcel/config-default',
env: { NODE_ENV: 'production' },
defaultTargetOptions: { publicUrl: '.' }
@ -40,7 +40,7 @@ process.env['PARCEL_WORKER_BACKEND'] = 'process';
.map(item => `${item.name}${item.isDirectory() ? '/**' : ''}`),
directories: {
output: 'build',
buildResources: 'src/assets'
buildResources: 'src-electron/assets'
},
win: {
target: [{

View File

@ -24,10 +24,10 @@ const
await installExtension(VUEJS3_DEVTOOLS);
const mainWindow = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, './src/preload.js'),
preload: path.join(__dirname, './src-electron/preload.js'),
spellcheck: isSpellcheckEnabled
},
icon: path.join(__dirname, './src/assets/icon.png'),
icon: path.join(__dirname, './src-electron/assets/icon.png'),
frame: isTitleBarEnabled,
show: false
});

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -4,7 +4,7 @@ import electron from 'electron';
import config from './config.js';
(async () => {
await new Parcel({
entries: 'src/index.html',
entries: 'src-vue/index.html',
defaultConfig: '@parcel/config-default',
env: { NODE_ENV: 'development' },
serveOptions: { port: config.devServerPort },