mirror of
https://github.com/xodio/xod.git
synced 2026-03-24 17:46:56 +01:00
Merge pull request #1667 from xodio/fix-include-bundled-libs
Fix including of bundled Arduino libraries in dev mode
This commit is contained in:
@@ -54,10 +54,28 @@ export const getFilePathToOpen = app => {
|
||||
return () => pathToOpen;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns Path to the resources directory root.
|
||||
*
|
||||
* When IDE runs in development mode it resolves to directory
|
||||
* with transpiled code, and it handles call either from Main Process
|
||||
* and Renderer Process. They're have a different `__dirname` values:
|
||||
* - Main Process: /some/path/to/src-babel/app
|
||||
* - Renderer Process: /some/path/to/src-babel
|
||||
*
|
||||
* When IDE runs in production mode it resolves to resources path.
|
||||
*/
|
||||
export const getResourcesRoot = () => {
|
||||
if (IS_DEV) {
|
||||
return process.type === 'renderer'
|
||||
? __dirname
|
||||
: path.resolve(__dirname, '..');
|
||||
}
|
||||
return process.resourcesPath;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns Path to the bundled workspace
|
||||
*/
|
||||
export const getPathToBundledWorkspace = () =>
|
||||
IS_DEV
|
||||
? path.resolve(__dirname, '../workspace')
|
||||
: path.resolve(process.resourcesPath, './workspace');
|
||||
path.join(getResourcesRoot(), 'workspace');
|
||||
|
||||
@@ -9,6 +9,10 @@ const pkgpath = subpath => path.resolve(__dirname, subpath);
|
||||
|
||||
module.exports = merge.smart(getBaseConfig(__dirname), {
|
||||
target: 'electron-renderer',
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false,
|
||||
},
|
||||
entry: [
|
||||
pkgpath('src/view/styles/main.scss'),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user