-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from lacymorrow/ai
Ai
- Loading branch information
Showing
38 changed files
with
18,605 additions
and
21,629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Webpack config for development electron main process | ||
*/ | ||
|
||
import path from 'path'; | ||
import webpack from 'webpack'; | ||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; | ||
import { merge } from 'webpack-merge'; | ||
import checkNodeEnv from '../scripts/check-node-env'; | ||
import baseConfig from './webpack.config.base'; | ||
import webpackPaths from './webpack.paths'; | ||
|
||
// When an ESLint server is running, we can't set the NODE_ENV so we'll check if it's | ||
// at the dev webpack config is not accidentally run in a production environment | ||
if (process.env.NODE_ENV === 'production') { | ||
checkNodeEnv('development'); | ||
} | ||
|
||
const configuration: webpack.Configuration = { | ||
devtool: 'inline-source-map', | ||
|
||
mode: 'development', | ||
|
||
target: 'electron-main', | ||
|
||
entry: { | ||
main: path.join(webpackPaths.srcMainPath, 'main.ts'), | ||
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'), | ||
}, | ||
|
||
output: { | ||
path: webpackPaths.dllPath, | ||
filename: '[name].bundle.dev.js', | ||
library: { | ||
type: 'umd', | ||
}, | ||
}, | ||
|
||
plugins: [ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
new BundleAnalyzerPlugin({ | ||
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled', | ||
analyzerPort: 8888, | ||
}), | ||
|
||
new webpack.DefinePlugin({ | ||
'process.type': '"browser"', | ||
}), | ||
], | ||
|
||
/** | ||
* Disables webpack processing of __dirname and __filename. | ||
* If you run the bundle in node.js it falls back to these values of node.js. | ||
* https://github.com/webpack/webpack/issues/2010 | ||
*/ | ||
node: { | ||
__dirname: false, | ||
__filename: false, | ||
}, | ||
}; | ||
|
||
export default merge(baseConfig, configuration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import fs from 'fs'; | ||
import webpackPaths from '../configs/webpack.paths'; | ||
|
||
const { srcNodeModulesPath } = webpackPaths; | ||
const { appNodeModulesPath } = webpackPaths; | ||
const { srcNodeModulesPath, appNodeModulesPath, erbNodeModulesPath } = | ||
webpackPaths; | ||
|
||
if (!fs.existsSync(srcNodeModulesPath) && fs.existsSync(appNodeModulesPath)) { | ||
fs.symlinkSync(appNodeModulesPath, srcNodeModulesPath, 'junction'); | ||
if (fs.existsSync(appNodeModulesPath)) { | ||
if (!fs.existsSync(srcNodeModulesPath)) { | ||
fs.symlinkSync(appNodeModulesPath, srcNodeModulesPath, 'junction'); | ||
} | ||
if (!fs.existsSync(erbNodeModulesPath)) { | ||
fs.symlinkSync(appNodeModulesPath, erbNodeModulesPath, 'junction'); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.