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",
"build": "NODE_ENV=development ./node_modules/.bin/webpack --progress",
"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",
"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;
require('./bootstrap');
// @ts-ignore
window.events = new Vue();
// @ts-ignore
window.Ziggy = Ziggy;
Vue.use(Vuex);
@ -26,7 +24,6 @@ Vue.use(VueRouter);
Vue.use(VeeValidate);
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;
Vue.mixin({methods: {route}});
@ -37,7 +34,6 @@ const i18n = new VueI18n({
messages: {...Locales},
});
// $FlowFixMe
if (module.hot) {
module.hot.accept();
}

View File

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

View File

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

View File

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