mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Babelify the main.jsO
This commit is contained in:
parent
2ebc64b271
commit
37359a905b
@ -1,45 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
if (require('electron-squirrel-startup')) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
import raven from 'raven';
|
||||
import request from 'request';
|
||||
import path from 'path';
|
||||
import * as packageJSON from './package.json';
|
||||
import electron from 'electron';
|
||||
import mkdirp from 'mkdirp';
|
||||
import fs from 'fs';
|
||||
|
||||
// Some useful helpers
|
||||
const IS_DEV = process.env.INSOMNIA_ENV === 'development';
|
||||
const IS_MAC = process.platform === 'darwin';
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
const IS_LINUX = !IS_MAC && !IS_WINDOWS;
|
||||
|
||||
var raven = require('raven');
|
||||
var ravenClient = new raven.Client(
|
||||
'https://786e43ae199c4757a9ea4a48a9abd17d@sentry.io/109702', {
|
||||
environment: process.env.INSOMNIA_ENV || 'production',
|
||||
release: require('./package.json').version,
|
||||
logger: 'electron.main'
|
||||
});
|
||||
var ravenClient = new raven.Client('https://786e43ae199c4757a9ea4a48a9abd17d@sentry.io/109702', {
|
||||
environment: process.env.INSOMNIA_ENV || 'production',
|
||||
release: require('./package.json').version,
|
||||
logger: 'electron.main'
|
||||
});
|
||||
|
||||
if (!IS_DEV) {
|
||||
ravenClient.patchGlobal();
|
||||
}
|
||||
|
||||
// Don't npm install this (it breaks). Rely on the global one.
|
||||
const request = require('request');
|
||||
const path = require('path');
|
||||
const {version: appVersion, productName: appName} = require('./package.json');
|
||||
const electron = require('electron');
|
||||
const mkdirp = require('mkdirp');
|
||||
const fs = require('fs');
|
||||
const {
|
||||
app,
|
||||
dialog,
|
||||
shell,
|
||||
ipcMain,
|
||||
autoUpdater,
|
||||
Menu,
|
||||
BrowserWindow,
|
||||
webContents
|
||||
} = require('electron');
|
||||
|
||||
const {app, dialog, shell, ipcMain, autoUpdater, Menu, BrowserWindow, webContents} = electron;
|
||||
const {version: appVersion, productName: appName} = packageJSON;
|
||||
const LOCAL_STORAGE_DIR = path.join(app.getPath('userData'), 'localStorage');
|
||||
|
||||
const UPDATE_URLS = {
|
@ -11,10 +11,11 @@
|
||||
"url": "https://github.com/gschier/insomnia"
|
||||
},
|
||||
"scripts": {
|
||||
"test:noisy": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test": "jest --silent",
|
||||
"test-noisy": "jest",
|
||||
"test-watch": "jest --watch",
|
||||
"start-hot": "cross-env HOT=1 INSOMNIA_ENV=development ./node_modules/electron/cli.js ./app/main.js",
|
||||
|
||||
"start-hot": "cross-env HOT=1 INSOMNIA_ENV=development electron -r babel-register ./app/main.development.js",
|
||||
"hot-server": "babel-node ./webpack/server.js",
|
||||
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\"",
|
||||
"build:clean": "rm -rf ./build && rm -rf ./dist && mkdir ./build",
|
||||
|
@ -4,7 +4,7 @@ import productionConfig from './webpack.config.production.babel';
|
||||
export default {
|
||||
...productionConfig,
|
||||
entry: [
|
||||
'./main.js'
|
||||
'./main.development.js'
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, '../build'),
|
||||
|
Loading…
Reference in New Issue
Block a user