forked from project-chip/zap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jing Teng
committed
Jul 7, 2021
1 parent
afdc7eb
commit 75aa709
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,18 +1,45 @@ | ||
const path = require('path') | ||
|
||
const nodeExternals = require('webpack-node-externals') | ||
|
||
const config = { | ||
node: { | ||
__dirname: true, | ||
__filename: true, | ||
}, | ||
mode: 'development', | ||
target: 'node', | ||
target: 'electron-main', | ||
entry: | ||
path.resolve(__dirname, 'src-electron') + '/main-process/electron-main.js', | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), | ||
filename: 'main.js', | ||
filename: 'electron-main.js', | ||
}, | ||
module: { | ||
rules: [{ test: /\.js$/, exclude: /node_modules/, use: 'babel-loader' }], | ||
rules: [ | ||
{ | ||
enforce: 'pre', | ||
test: /\.js$/, | ||
loader: 'eslint-loader', | ||
exclude: /node_modules/, | ||
options: { | ||
formatter: require('eslint').CLIEngine.getFormatter('stylish'), | ||
}, | ||
}, | ||
{ test: /\.js$/, exclude: /node_modules/, use: 'babel-loader' }, | ||
{ | ||
enforce: 'pre', | ||
test: /\.(sql)$/, | ||
loader: 'file-loader', | ||
exclude: /node_modules/, | ||
options: { | ||
name: '[path][name].[ext]', | ||
}, | ||
}, | ||
], | ||
}, | ||
devtool: 'source-map', | ||
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder | ||
} | ||
|
||
module.exports = config |