diff --git a/src/appPaths.js b/src/appPaths.js index 01171ca3..8d8d0390 100644 --- a/src/appPaths.js +++ b/src/appPaths.js @@ -123,6 +123,12 @@ const storageFiles = { } } +function get (relativePath) { + return process.env.NODE_ENV === 'production' + ? PATH.join(__dirname, relativePath) + : PATH.join(relativePath) +} + const storageDirectories = { appStorage, appStorageMedia, @@ -134,6 +140,7 @@ const storageDirectories = { } const appPaths = { + get, storageFiles, storageDirectories, resources, diff --git a/src/store.js b/src/store.js index f831eb09..3ea05ef3 100644 --- a/src/store.js +++ b/src/store.js @@ -5764,7 +5764,7 @@ export default new Vuex.Store({ }, task.props.options.timeout) } store.state.childProcesses.directorySize = childProcess.fork( - PATH.resolve('./src/processes/directorySizeProcess.js'), + appPaths.get('./src/processes/directorySizeProcess.js'), { silent: true } ) store.state.childProcesses.directorySize.on('message', data => { diff --git a/vue.config.js b/vue.config.js index bddb40c5..c4c62c1e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -78,7 +78,13 @@ module.exports = { './src/utils/search.js' ], // Exclude dependencies from the output bundles - externals: ['chokidar', 'fsevents', 'xxhash-addon', 'fswin'], + externals: [ + 'chokidar', + 'fsevents', + 'xxhash-addon', + 'fswin', + 'trammel' + ], // Webpack config for electron renderer process only chainWebpackRendererProcess: (config) => { config.plugin('define').tap(args => {