问题: 语法错误:不能在模块外使用导入语句
来自 从router.js中的“vue-router”导入VueRouter;
router.js
import VueRouter from "vue-router";
import Vue from "vue";
. . . . .
export { router, routes };
vue.config.js
const path = require('path');
const PrerenderSpaPlugin = require('prerender-spa-plugin');
const routes = require('./src/router.js').routes
module.exports = {
pluginOptions: {
sitemap: {
baseURL: 'https://example.com',
routes
}
}
};