Miscelaneous fixes for WP

This commit is contained in:
Dane Everitt 2019-02-02 18:49:51 -08:00
parent 91cf735646
commit ea923053eb
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
5 changed files with 13 additions and 7 deletions

View File

@ -64,7 +64,7 @@
"watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress", "watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
"build": "NODE_ENV=development ./node_modules/.bin/webpack --progress", "build": "NODE_ENV=development ./node_modules/.bin/webpack --progress",
"build:production": "NODE_ENV=production ./node_modules/.bin/webpack", "build:production": "NODE_ENV=production ./node_modules/.bin/webpack",
"serve": "NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot --hot-only", "serve": "NODE_ENV=development webpack-dev-server --host 0.0.0.0 --hot",
"v:serve": "PUBLIC_PATH=http://pterodactyl.test:8080 yarn run serve", "v:serve": "PUBLIC_PATH=http://pterodactyl.test:8080 yarn run serve",
"compile:assets": "php artisan vue-i18n:generate & php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js" "compile:assets": "php artisan vue-i18n:generate & php artisan ziggy:generate resources/assets/scripts/helpers/ziggy.js"
} }

View File

@ -16,9 +16,7 @@ import router from './router';
Vue.config.productionTip = false; Vue.config.productionTip = false;
require('./bootstrap'); require('./bootstrap');
// @ts-ignore
window.events = new Vue(); window.events = new Vue();
// @ts-ignore
window.Ziggy = Ziggy; window.Ziggy = Ziggy;
Vue.use(Vuex); Vue.use(Vuex);
@ -26,7 +24,6 @@ Vue.use(VueRouter);
Vue.use(VeeValidate); Vue.use(VeeValidate);
Vue.use(VueI18n); Vue.use(VueI18n);
// $FlowFixMe: this is always going to be unhappy because we ignore the vendor dir.
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default; const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
Vue.mixin({methods: {route}}); Vue.mixin({methods: {route}});
@ -37,7 +34,6 @@ const i18n = new VueI18n({
messages: {...Locales}, messages: {...Locales},
}); });
// $FlowFixMe
if (module.hot) { if (module.hot) {
module.hot.accept(); module.hot.accept();
} }

View File

@ -4,6 +4,8 @@ import {FlashInterface} from "./mixins/flash";
import {AxiosInstance} from "axios"; import {AxiosInstance} from "axios";
import {Vue as VueType} from "vue/types/vue"; import {Vue as VueType} from "vue/types/vue";
import {ApplicationState} from "./store/types"; import {ApplicationState} from "./store/types";
// @ts-ignore
import {Ziggy} from './helpers/ziggy';
declare global { declare global {
interface Window { interface Window {
@ -13,6 +15,7 @@ declare global {
jQuery: any, jQuery: any,
axios: AxiosInstance, axios: AxiosInstance,
events: VueType, events: VueType,
Ziggy: Ziggy,
} }
} }

View File

@ -7,7 +7,13 @@
"lib": [ "lib": [
"es2016", "es2016",
"dom" "dom"
] ],
"baseUrl": ".",
"paths": {
"@/*": [
"./resources/assets/scripts/*"
]
}
}, },
"include": [ "include": [
"./resources/assets/scripts/**/*" "./resources/assets/scripts/**/*"

View File

@ -106,6 +106,7 @@ const cssLoaders = [
]; ];
module.exports = { module.exports = {
target: 'web',
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
devtool: isProduction ? false : 'inline-source-map', devtool: isProduction ? false : 'inline-source-map',
performance: { performance: {
@ -201,7 +202,7 @@ module.exports = {
}, },
devServer: { devServer: {
contentBase: path.join(__dirname, 'public'), contentBase: path.join(__dirname, 'public'),
publicPath: '/assets/', publicPath: _.get(process.env, 'PUBLIC_PATH', '') + '/assets/',
allowedHosts: [ allowedHosts: [
'.pterodactyl.test', '.pterodactyl.test',
], ],