import Vue from 'vue';
import { BASE_URL } from '@/utils/enumerate';
import rocNative from '@/utils/jsbridge';
import WebBuriedPoint, { sendBuriedData } from 'web-buried-point';

const { name } = require('../package.json');
const cookies = require('cookie-universal')();
// const { NUXT_ENV_APP } = process.env;

Vue.prototype.$cookies = cookies;
Vue.prototype.$rocNative = new rocNative();
Vue.prototype.$sendBuriedData = sendBuriedData;

if (name === 'nuxt_ssr') throw Error('需要给当前项目起一个有意义的名称，多英文单词用 _ 拼接，不能有空格。修改文件：package.json (name)');
// Vue.use(WebBuriedPoint, {
//   class_name: name,
//   url: `${BASE_URL[NUXT_ENV_APP]}/file/log/trace1`
// });