refs #850 Fix babel settings for production build

This commit is contained in:
AkiraFukushima 2019-04-18 16:15:50 +09:00
parent 21cd02bf64
commit 3a157476dd
13 changed files with 443 additions and 780 deletions

View File

@ -8,14 +8,24 @@
}], }],
"@babel/preset-typescript" "@babel/preset-typescript"
], ],
"plugins": ["istanbul"] "plugins": [
"istanbul",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
]
}, },
"main": { "main": {
"presets": [ "presets": [
["@babel/preset-env", { ["@babel/preset-env", {
"targets": { "node": 9 } "targets": { "node": 9 }
}], }],
"stage-0" "@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
] ]
}, },
"renderer": { "renderer": {
@ -25,14 +35,23 @@
"targets": { "node": "current" } "targets": { "node": "current" }
}], }],
"@babel/preset-typescript" "@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-runtime"
] ]
}, },
"web": { "web": {
"presets": [ "presets": [
["@babel/preset-env", { ["@babel/preset-env", {
"modules": false "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$/, test: /\.ts$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: [
loader: 'ts-loader', {
options: { loader: 'babel-loader'
appendTsSuffixTo: [/\.vue$/] },
{
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
}
} }
} ]
}, },
{ {
test: /\.js$/, test: /\.js$/,

1150
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -167,8 +167,13 @@
"vuex-router-sync": "^5.0.0" "vuex-router-sync": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-env": "^7.4.2", "@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/preset-typescript": "^7.3.3", "@babel/preset-typescript": "^7.3.3",
"@babel/runtime": "^7.4.3",
"@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0", "@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0",
"@types/electron-json-storage": "^4.0.0", "@types/electron-json-storage": "^4.0.0",
"@types/i18next": "^12.1.0", "@types/i18next": "^12.1.0",
@ -182,13 +187,11 @@
"@typescript-eslint/typescript-estree": "^1.5.0", "@typescript-eslint/typescript-estree": "^1.5.0",
"@vue/test-utils": "^1.0.0-beta.28", "@vue/test-utils": "^1.0.0-beta.28",
"ajv": "^6.6.1", "ajv": "^6.6.1",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-jest": "^24.5.0", "babel-jest": "^24.5.0",
"babel-loader": "^8.0.5", "babel-loader": "^8.0.5",
"babel-minify-webpack-plugin": "^0.3.1", "babel-minify-webpack-plugin": "^0.3.1",
"babel-plugin-istanbul": "^5.1.0", "babel-plugin-istanbul": "^5.1.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0", "babel-register": "^6.26.0",
"cfonts": "^2.3.0", "cfonts": "^2.3.0",
"chai": "^4.2.0", "chai": "^4.2.0",
@ -201,7 +204,7 @@
"devtron": "^1.4.0", "devtron": "^1.4.0",
"electron": "4.0.8", "electron": "4.0.8",
"electron-builder": "^20.39.0", "electron-builder": "^20.39.0",
"electron-debug": "^2.0.0", "electron-debug": "^2.2.0",
"electron-devtools-installer": "^2.2.4", "electron-devtools-installer": "^2.2.4",
"electron-ipc-mock": "0.0.3", "electron-ipc-mock": "0.0.3",
"electron-packager": "^12.2.0", "electron-packager": "^12.2.0",

View File

@ -1,6 +1,6 @@
import Mastodon from 'megalodon' import Mastodon from 'megalodon'
import Account from './account' import Account from './account'
import LocalAccount from '~src/types/localAccount' import LocalAccount from '~/src/types/localAccount'
const appName = 'Whalebird' const appName = 'Whalebird'
const appURL = 'https://whalebird.org' const appURL = 'https://whalebird.org'

View File

@ -21,8 +21,8 @@ import Hashtags from './hashtags'
import UnreadNotification from './unreadNotification' import UnreadNotification from './unreadNotification'
import i18n from '../config/i18n' import i18n from '../config/i18n'
import Language from '../constants/language' import Language from '../constants/language'
import LocalAccount from '~src/types/localAccount' import LocalAccount from '~/src/types/localAccount'
import LocalTag from '~src/types/localTag' import LocalTag from '~/src/types/localTag'
import { UnreadNotification as UnreadNotificationConfig } from '~/src/types/unreadNotification' import { UnreadNotification as UnreadNotificationConfig } from '~/src/types/unreadNotification'
/** /**
@ -49,7 +49,7 @@ if (process.env.NODE_ENV !== 'development') {
} }
let mainWindow: BrowserWindow | null let mainWindow: BrowserWindow | null
let tray: Tray let tray: Tray | null
const winURL = process.env.NODE_ENV === 'development' const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080` ? `http://localhost:9080`
: `file://${__dirname}/index.html` : `file://${__dirname}/index.html`
@ -1038,6 +1038,12 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, i18n
}, },
...accountsChange ...accountsChange
] ]
},
{
label: 'debug',
click: () => {
mainWindow!.webContents.openDevTools()
}
} }
] ]

View File

@ -1,6 +1,6 @@
import Streaming from './streaming' import Streaming from './streaming'
import WebSocket from './websocket' import WebSocket from './websocket'
import LocalAccount from '~src/types/localAccount' import LocalAccount from '~/src/types/localAccount'
export default class StreamingManager { export default class StreamingManager {
private streaming: Streaming private streaming: Streaming

View File

@ -1,6 +1,6 @@
import Mastodon, { WebSocket as SocketListener, Status, Notification } from 'megalodon' import Mastodon, { WebSocket as SocketListener, Status, Notification } from 'megalodon'
import log from 'electron-log' import log from 'electron-log'
import LocalAccount from '~src/types/localAccount' import LocalAccount from '~/src/types/localAccount'
export default class WebSocket { export default class WebSocket {
private client: Mastodon private client: Mastodon

View File

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