ing
This commit is contained in:
commit
5a038f2de5
|
@ -7,20 +7,20 @@ const projectRoot = path.dirname(__dirname, '..');
|
|||
|
||||
const channel = getReleaseChannel();
|
||||
|
||||
const s = JSON.stringify;
|
||||
|
||||
function getReplacements() {
|
||||
return {
|
||||
__DARWIN__: process.platform === 'darwin',
|
||||
__WIN32__: process.platform === 'win32',
|
||||
__LINUX__: process.platform === 'linux',
|
||||
__DEV__: channel === 'development',
|
||||
__RELEASE_CHANNEL__: s(channel),
|
||||
__UPDATES_URL__: s(getUpdatesURL()),
|
||||
'process.platform': s(process.platform),
|
||||
'process.env.NODE_ENV': s(process.env.NODE_ENV || 'development'),
|
||||
'process.env.TEST_ENV': s(process.env.TEST_ENV),
|
||||
}
|
||||
__RELEASE_CHANNEL__: JSON.stringify(channel),
|
||||
__UPDATES_URL__: JSON.stringify(getUpdatesURL()),
|
||||
'process.platform': JSON.stringify(process.platform),
|
||||
'process.env.NODE_ENV': JSON.stringify(
|
||||
process.env.NODE_ENV || 'development'
|
||||
),
|
||||
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV)
|
||||
};
|
||||
}
|
||||
|
||||
exports.getReplacements = getReplacements;
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
@ -13,8 +13,7 @@ const replacements = getReplacements();
|
|||
const EVENT = process.env.npm_lifecycle_event || '';
|
||||
const PROD = EVENT.includes('prod');
|
||||
|
||||
|
||||
module.exports = function () {
|
||||
module.exports = (function() {
|
||||
const tsConfigBase = './src/tsconfig.electron.json';
|
||||
|
||||
const atlConfig = {
|
||||
|
@ -27,20 +26,17 @@ module.exports = function () {
|
|||
config.devtool = PROD ? false : 'cheap-module-source-map';
|
||||
config.externals = [nodeExternals()];
|
||||
config.entry = {
|
||||
'index': root('src', 'electron', 'main.ts')
|
||||
index: root('src', 'electron', 'main.ts')
|
||||
};
|
||||
config.output = {
|
||||
path: PROD ? root('build', 'dist') : root('build', 'dev'),
|
||||
filename: '[name].js',
|
||||
sourceMapFilename: '[file].map',
|
||||
sourceMapFilename: '[file].map'
|
||||
};
|
||||
config.resolve = {
|
||||
extensions: ['.ts', '.tsx', '.mjs', '.js'],
|
||||
modules: [
|
||||
root(),
|
||||
'node_modules',
|
||||
],
|
||||
}
|
||||
modules: [root(), 'node_modules']
|
||||
};
|
||||
config.module = {
|
||||
rules: [
|
||||
{
|
||||
|
@ -59,17 +55,14 @@ module.exports = function () {
|
|||
};
|
||||
config.plugins = [
|
||||
PROD ? new webpack.NoEmitOnErrorsPlugin() : null,
|
||||
// PROD ? new CopyWebpackPlugin(
|
||||
// [
|
||||
// 'config/package.json'
|
||||
// ]
|
||||
// ) : null,
|
||||
new webpack.DefinePlugin(
|
||||
Object.assign({}, replacements, {
|
||||
__PROCESS_KIND__: JSON.stringify('main'),
|
||||
__PROCESS_KIND__: JSON.stringify('main')
|
||||
})
|
||||
),
|
||||
PROD ? null : new ElectronConnectWebpackPlugin({
|
||||
PROD
|
||||
? null
|
||||
: new ElectronConnectWebpackPlugin({
|
||||
path: root('build', 'dev'),
|
||||
stopOnClose: true,
|
||||
logLevel: 0
|
||||
|
@ -77,5 +70,4 @@ module.exports = function () {
|
|||
].filter(plugin => plugin !== null);
|
||||
|
||||
return config;
|
||||
|
||||
}();
|
||||
})();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"extraMetadata": {
|
||||
"name": "overflow-network-scanner"
|
||||
},
|
||||
"asar": true,
|
||||
"asar": false,
|
||||
"compression": "normal",
|
||||
"npmRebuild": false,
|
||||
"npmSkipBuildFromSource": false,
|
||||
|
@ -75,7 +75,6 @@
|
|||
],
|
||||
"category": "public.app-category.utilities",
|
||||
"minimumSystemVersion": "10.12.0",
|
||||
"extendInfo": "config/build/mac/Info.plist",
|
||||
"icon": "config/build/mac/icon/overflow_1024.icns",
|
||||
"extraResources": [
|
||||
{
|
||||
|
@ -87,8 +86,8 @@
|
|||
"pkg": {
|
||||
"background": "config/build/mac/dmg/background.png",
|
||||
"icon": "config/build/mac/dmg/icon.icns",
|
||||
"iconSize": 80,
|
||||
"iconTextSize": 12,
|
||||
"iconSize": 120,
|
||||
"iconTextSize": 18,
|
||||
"contents": [
|
||||
{
|
||||
"x": 480,
|
||||
|
|
Loading…
Reference in New Issue
Block a user