2019-06-23 03:35:23 -07:00
|
|
|
// The Vue build version to load with the `import` command
|
|
|
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
2021-08-29 04:36:17 -07:00
|
|
|
import './plugins';
|
2019-09-11 01:59:50 -07:00
|
|
|
import 'prismjs';
|
|
|
|
import 'prismjs/themes/prism.css';
|
|
|
|
import 'vue-prism-editor/dist/VuePrismEditor.css';
|
2020-12-18 09:55:53 -08:00
|
|
|
import 'vue-json-pretty/lib/styles.css';
|
2022-09-23 07:14:28 -07:00
|
|
|
|
|
|
|
import 'n8n-design-system/css/index.scss';
|
2019-06-23 03:35:23 -07:00
|
|
|
import './n8n-theme.scss';
|
|
|
|
|
2021-09-21 05:35:55 -07:00
|
|
|
import "@fontsource/open-sans/latin-400.css";
|
|
|
|
import "@fontsource/open-sans/latin-600.css";
|
|
|
|
import "@fontsource/open-sans/latin-700.css";
|
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
import App from '@/App.vue';
|
|
|
|
import router from './router';
|
|
|
|
|
2021-01-19 14:48:30 -08:00
|
|
|
import { runExternalHook } from './components/mixins/externalHooks';
|
2021-10-18 20:57:49 -07:00
|
|
|
import { TelemetryPlugin } from './plugins/telemetry';
|
2022-09-05 07:36:22 -07:00
|
|
|
import { I18nPlugin, i18nInstance } from './plugins/i18n';
|
2021-01-19 14:48:30 -08:00
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
import { createPinia, PiniaVuePlugin } from 'pinia';
|
|
|
|
|
2022-11-09 01:01:50 -08:00
|
|
|
import { useWebhooksStore } from './stores/webhooks';
|
2020-10-23 04:44:34 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
2021-10-18 20:57:49 -07:00
|
|
|
Vue.use(TelemetryPlugin);
|
2022-11-09 01:01:50 -08:00
|
|
|
Vue.use((vue) => I18nPlugin(vue));
|
2022-11-04 06:04:31 -07:00
|
|
|
Vue.use(PiniaVuePlugin);
|
|
|
|
|
|
|
|
const pinia = createPinia();
|
2021-10-18 20:57:49 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
new Vue({
|
2022-09-05 07:36:22 -07:00
|
|
|
i18n: i18nInstance,
|
2019-06-23 03:35:23 -07:00
|
|
|
router,
|
2022-11-04 06:04:31 -07:00
|
|
|
pinia,
|
2019-06-23 03:35:23 -07:00
|
|
|
render: h => h(App),
|
|
|
|
}).$mount('#app');
|
|
|
|
|
2022-11-09 01:01:50 -08:00
|
|
|
router.afterEach((to, from) => {
|
|
|
|
runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
|
|
|
|
});
|
|
|
|
|
2022-09-23 07:14:28 -07:00
|
|
|
if (import.meta.env.NODE_ENV !== 'production') {
|
2019-06-23 03:35:23 -07:00
|
|
|
// Make sure that we get all error messages properly displayed
|
|
|
|
// as long as we are not in production mode
|
|
|
|
window.onerror = (message, source, lineno, colno, error) => {
|
|
|
|
if (message.toString().includes('ResizeObserver')) {
|
|
|
|
// That error can apparently be ignored and can probably
|
|
|
|
// not do anything about it anyway
|
|
|
|
return;
|
|
|
|
}
|
2020-04-05 18:06:00 -07:00
|
|
|
console.error('error caught in main.ts'); // eslint-disable-line no-console
|
2019-09-22 13:03:58 -07:00
|
|
|
console.error(message); // eslint-disable-line no-console
|
|
|
|
console.error(error); // eslint-disable-line no-console
|
2019-06-23 03:35:23 -07:00
|
|
|
};
|
|
|
|
}
|