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