This commit is contained in:
crusader 2018-10-04 02:20:12 +09:00
parent 258f77abe3
commit 95e68aaec9
5 changed files with 34 additions and 60 deletions

View File

@ -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.

View File

@ -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;
}();
})();

View File

@ -5,7 +5,7 @@
"extraMetadata": {
"name": "overflow-network-scanner"
},
"asar": true,
"asar": false,
"compression": "normal",
"npmRebuild": false,
"npmSkipBuildFromSource": false,
@ -17,19 +17,12 @@
"files": [
"packages.json",
{
"filter": [
"**/*",
"!*.ts",
"!*.scss",
"!yarn.lock"
],
"filter": ["**/*", "!*.ts", "!*.scss", "!yarn.lock"],
"from": "./build/dist/",
"to": "."
},
{
"filter": [
"**/*"
],
"filter": ["**/*"],
"from": "config/build/${os}/icon/",
"to": "./assets/image/icon/"
}
@ -44,10 +37,7 @@
"target": [
{
"target": "deb",
"arch": [
"ia32",
"x64"
]
"arch": ["ia32", "x64"]
}
],
"category": "Network;Monitor;",
@ -64,18 +54,13 @@
}
},
"deb": {
"depends": [
"libpcap0.8"
],
"depends": ["libpcap0.8"],
"afterInstall": "config/build/linux/debian/after-install.tpl"
},
"mac": {
"target": [
"dmg"
],
"target": ["dmg"],
"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 +72,8 @@
"dmg": {
"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,
@ -107,10 +92,7 @@
"target": [
{
"target": "nsis",
"arch": [
"x64",
"ia32"
]
"arch": ["x64", "ia32"]
}
],
"legalTrademarks": "overFlow",