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';
|
|
|
|
|
2020-12-18 09:55:53 -08:00
|
|
|
import 'vue-json-pretty/lib/styles.css';
|
2023-01-30 09:20:50 -08:00
|
|
|
import '@jsplumb/browser-ui/css/jsplumbtoolkit.css';
|
2022-09-23 07:14:28 -07:00
|
|
|
import 'n8n-design-system/css/index.scss';
|
2023-04-26 00:18:10 -07:00
|
|
|
|
2023-06-16 00:30:57 -07:00
|
|
|
import './n8n-theme.scss';
|
2023-02-16 03:47:19 -08:00
|
|
|
import './styles/autocomplete-theme.scss';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-12-14 01:04:10 -08:00
|
|
|
import '@fontsource/open-sans/latin-400.css';
|
|
|
|
import '@fontsource/open-sans/latin-600.css';
|
|
|
|
import '@fontsource/open-sans/latin-700.css';
|
2021-09-21 05:35:55 -07:00
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
import App from '@/App.vue';
|
|
|
|
import router from './router';
|
|
|
|
|
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';
|
2023-06-16 00:30:57 -07:00
|
|
|
import { GlobalComponentsPlugin } from './plugins/components';
|
|
|
|
import { GlobalDirectivesPlugin } from './plugins/directives';
|
|
|
|
import { FontAwesomePlugin } from './plugins/icons';
|
2021-01-19 14:48:30 -08:00
|
|
|
|
2023-06-16 00:30:57 -07:00
|
|
|
import { runExternalHook } from '@/utils';
|
2022-11-04 06:04:31 -07:00
|
|
|
import { createPinia, PiniaVuePlugin } from 'pinia';
|
2023-06-19 07:23:57 -07:00
|
|
|
import { useWebhooksStore, useUIStore } from '@/stores';
|
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-04 06:04:31 -07:00
|
|
|
Vue.use(PiniaVuePlugin);
|
|
|
|
|
2023-06-16 00:30:57 -07:00
|
|
|
Vue.use(I18nPlugin);
|
|
|
|
Vue.use(FontAwesomePlugin);
|
|
|
|
Vue.use(GlobalComponentsPlugin);
|
|
|
|
Vue.use(GlobalDirectivesPlugin);
|
|
|
|
|
2022-11-04 06:04:31 -07:00
|
|
|
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,
|
2022-12-14 01:04:10 -08:00
|
|
|
render: (h) => h(App),
|
2019-06-23 03:35:23 -07:00
|
|
|
}).$mount('#app');
|
|
|
|
|
2022-11-09 01:01:50 -08:00
|
|
|
router.afterEach((to, from) => {
|
2023-06-19 07:23:57 -07:00
|
|
|
useUIStore().restoreBanner('v1');
|
|
|
|
|
2023-05-10 08:10:03 -07:00
|
|
|
void runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
|
2022-11-09 01:01:50 -08:00
|
|
|
});
|
|
|
|
|
2023-01-11 13:22:12 -08:00
|
|
|
if (!import.meta.env.PROD) {
|
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
|
|
|
};
|
|
|
|
}
|