Merge pull request #886 from h3poteto/build
refs #850 Fix babel settings for production build
This commit is contained in:
commit
f819d49d5b
34
.babelrc
34
.babelrc
|
@ -5,17 +5,25 @@
|
|||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"targets": { "node": 9 }
|
||||
}],
|
||||
"@babel/preset-typescript"
|
||||
}]
|
||||
],
|
||||
"plugins": ["istanbul"]
|
||||
"plugins": [
|
||||
"istanbul",
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
},
|
||||
"main": {
|
||||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"targets": { "node": 9 }
|
||||
}],
|
||||
"stage-0"
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
},
|
||||
"renderer": {
|
||||
|
@ -23,16 +31,24 @@
|
|||
["@babel/preset-env", {
|
||||
"modules": false,
|
||||
"targets": { "node": "current" }
|
||||
}],
|
||||
"@babel/preset-typescript"
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
},
|
||||
"web": {
|
||||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"modules": false
|
||||
}],
|
||||
"stage-0"
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-class-properties",
|
||||
"@babel/plugin-proposal-object-rest-spread",
|
||||
"@babel/plugin-transform-runtime"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,12 +65,17 @@ let rendererConfig = {
|
|||
{
|
||||
test: /\.ts$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
use: [
|
||||
{
|
||||
loader: 'babel-loader'
|
||||
},
|
||||
{
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
appendTsSuffixTo: [/\.vue$/]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
|
@ -167,8 +167,12 @@
|
|||
"vuex-router-sync": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.4.2",
|
||||
"@babel/preset-typescript": "^7.3.3",
|
||||
"@babel/core": "^7.4.3",
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.4.3",
|
||||
"@babel/plugin-transform-runtime": "^7.4.3",
|
||||
"@babel/preset-env": "^7.4.3",
|
||||
"@babel/runtime": "^7.4.3",
|
||||
"@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0",
|
||||
"@types/electron-json-storage": "^4.0.0",
|
||||
"@types/i18next": "^12.1.0",
|
||||
|
@ -182,13 +186,11 @@
|
|||
"@typescript-eslint/typescript-estree": "^1.5.0",
|
||||
"@vue/test-utils": "^1.0.0-beta.28",
|
||||
"ajv": "^6.6.1",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-jest": "^24.5.0",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-minify-webpack-plugin": "^0.3.1",
|
||||
"babel-plugin-istanbul": "^5.1.0",
|
||||
"babel-preset-stage-0": "^6.24.1",
|
||||
"babel-register": "^6.26.0",
|
||||
"cfonts": "^2.3.0",
|
||||
"chai": "^4.2.0",
|
||||
|
@ -201,7 +203,7 @@
|
|||
"devtron": "^1.4.0",
|
||||
"electron": "4.0.8",
|
||||
"electron-builder": "^20.39.0",
|
||||
"electron-debug": "^2.0.0",
|
||||
"electron-debug": "^2.2.0",
|
||||
"electron-devtools-installer": "^2.2.4",
|
||||
"electron-ipc-mock": "0.0.3",
|
||||
"electron-packager": "^12.2.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Mastodon from 'megalodon'
|
||||
import Account from './account'
|
||||
import LocalAccount from '~src/types/localAccount'
|
||||
import LocalAccount from '~/src/types/localAccount'
|
||||
|
||||
const appName = 'Whalebird'
|
||||
const appURL = 'https://whalebird.org'
|
||||
|
|
|
@ -21,8 +21,8 @@ import Hashtags from './hashtags'
|
|||
import UnreadNotification from './unreadNotification'
|
||||
import i18n from '../config/i18n'
|
||||
import Language from '../constants/language'
|
||||
import LocalAccount from '~src/types/localAccount'
|
||||
import LocalTag from '~src/types/localTag'
|
||||
import LocalAccount from '~/src/types/localAccount'
|
||||
import LocalTag from '~/src/types/localTag'
|
||||
import { UnreadNotification as UnreadNotificationConfig } from '~/src/types/unreadNotification'
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,7 @@ if (process.env.NODE_ENV !== 'development') {
|
|||
}
|
||||
|
||||
let mainWindow: BrowserWindow | null
|
||||
let tray: Tray
|
||||
let tray: Tray | null
|
||||
const winURL = process.env.NODE_ENV === 'development'
|
||||
? `http://localhost:9080`
|
||||
: `file://${__dirname}/index.html`
|
||||
|
@ -1038,6 +1038,12 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, i18n
|
|||
},
|
||||
...accountsChange
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'debug',
|
||||
click: () => {
|
||||
mainWindow!.webContents.openDevTools()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Streaming from './streaming'
|
||||
import WebSocket from './websocket'
|
||||
import LocalAccount from '~src/types/localAccount'
|
||||
import LocalAccount from '~/src/types/localAccount'
|
||||
|
||||
export default class StreamingManager {
|
||||
private streaming: Streaming
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Mastodon, { WebSocket as SocketListener, Status, Notification } from 'megalodon'
|
||||
import log from 'electron-log'
|
||||
import LocalAccount from '~src/types/localAccount'
|
||||
import LocalAccount from '~/src/types/localAccount'
|
||||
|
||||
export default class WebSocket {
|
||||
private client: Mastodon
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
declare module "*.vue" {
|
||||
declare module '*.vue' {
|
||||
import Vue from 'vue'
|
||||
export default Vue
|
||||
}
|
Loading…
Reference in New Issue