Merge pull request #886 from h3poteto/build

refs #850 Fix babel settings for production build
This commit is contained in:
AkiraFukushima 2019-04-19 23:18:53 +09:00 committed by GitHub
commit f819d49d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 4314 additions and 4689 deletions

View File

@ -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"
]
}
}

View File

@ -65,12 +65,17 @@ let rendererConfig = {
{
test: /\.ts$/,
exclude: /node_modules/,
use: {
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
use: [
{
loader: 'babel-loader'
},
{
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
}
}
}
]
},
{
test: /\.js$/,

8922
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
declare module "*.vue" {
declare module '*.vue' {
import Vue from 'vue'
export default Vue
}