加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nuxt.config.js 18.19 KB
一键复制 编辑 原始数据 按行查看 历史
chenshengsoft 提交于 2023-03-30 14:26 . 初始化版本
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
const webpack = require('webpack')
var TerserPlugin = require('terser-webpack-plugin')
export default {
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
// title: '网校',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
script:[
{ src: 'https://cdn.polyfill.io/v2/polyfill.min.js' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.jpg' }
]
},
router:{
extendRoutes (routes, resolve) {
routes.push(
{
name: 'shijuan',
path: '/shijuan',
meta:{
title:"试卷详情",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/shijuan.vue'),
},
{
name: 'testVideo',
path: '/testVideo',
meta:{
title:"测试",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/testVideo.vue'),
},
{
name: 'resultForAdmin',
path: '/resultForAdmin',
meta:{
title:"测试结果",
isLogin:false
},
component: resolve(__dirname, 'pages/content/resultForAdmin.vue'),
},
{
name: 'dbcourser',
path: '/dbcourse/:id',
meta:{
title:"课程详情",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/dbcourse.vue'),
},
{
name: 'result1',
path: '/result1/:id/:courseId',
meta:{
title:"测试结果",
isLogin:true
},
component: resolve(__dirname, 'pages/content/result1.vue'),
},
{
name: 'center',
path: '/center',
meta:{
title:"个人中心",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/center.vue'),
children:[
{
name: 'home',
path: '/home',
meta:{
title:"个人中心首页",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/home.vue'),
},
{
name: 'result',
path: '/result',
meta:{
title:"测试结果",
isLogin:true
},
component: resolve(__dirname, 'pages/content/result.vue'),
},
{
name: 'signUp',
path: '/signUp',
meta:{
title:"考试报名",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/signUp.vue'),
},
{
name: 'signuppage',
path: '/signuppage',
meta:{
title:"考试报名",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/signuppage.vue'),
},
// {
// name: 'mocks',
// path: '/mocks',
// meta:{
// title:"模拟考试",
// sort:"",
// isLogin:true
// },
// component: resolve(__dirname, 'pages/person/mocks.vue'),
// },
{
name: 'exams',
path: '/exams',
meta:{
title:"正式考试",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/exams.vue'),
},
{
name: 'mockTest',
path: '/mockTest',
meta:{
title:"模拟练习",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/mockTest.vue'),
},
{
name: 'gonggao2',
path: '/gonggao2',
meta:{
title:"公告",
sort:"",
},
component: resolve(__dirname, 'pages/main/gonggao2.vue'),
},
{
name: 'gonggaolan',
path: '/gonggaolan/:id',
meta:{
title:"公告",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/gonggaolan.vue'),
},
{
name: 'inquireScore',
path: '/inquireScore',
meta:{
title:"查看成绩",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/inquireScore.vue'),
},
{
name: 'data',
path: '/data',
meta:{
title:"个人资料",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/data.vue'),
},
{
name: 'password',
path: '/password',
meta:{
title:"修改密码",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/password.vue'),
},
{
name: 'edit_data',
path: '/edit_data',
meta:{
title:"修改资料",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/editData.vue'),
},
{
name: 'course_center',
path: '/course_center',
meta:{
title:"课程中心",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/course.vue'),
},
{
name: 'train',
path: '/train',
meta:{
title:"培训计划",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/plan.vue'),
},
{
name: 'certificate',
path: '/certificate',
meta:{
title:"我的证书",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/certificate.vue'),
},
{
name: 'certificate_details',
path: '/certificate_details',
meta:{
title:"查看证书",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/certificate_details.vue'),
},
{
name: 'collection',
path: '/collection',
meta:{
title:"我的收藏",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/collection.vue'),
},
{
name: 'courseCenter',
path: '/courseCenter/:id',
meta:{
title:"我的课程",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/courseCenter.vue'),
},
{
name: 'mycourse',
path: '/mycourse',
meta:{
title:"我的课程",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/mycourse.vue'),
},
{
name: 'my_help',
path: '/my_help',
meta:{
title:"个人帮助中心",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/myhelp.vue'),
},
{
name: 'archives',
path: '/archives',
meta:{
title:"学习档案",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/person/archives.vue'),
},
]
},
{
name: 'play',
path: '/play/:id/:id1',
meta:{
title:"观看课程",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/movie.vue'),
},
{
name: 'ppt_course',
path: '/ppt_course/:id/:detailId',
meta:{
title:"观看课程",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/pCourse.vue'),
},
{
name: 'live',
path: '/live/:id',
meta:{
title:"观看直播",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/live.vue'),
},
{
name: 'play1',
path: '/play1',
meta:{
title:"观看课程1",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/movie1.vue'),
},
{
name: 'login',
path: '/login',
meta:{
title:"登录",
sort:"",
},
component: resolve(__dirname, 'pages/login/login.vue'),
},
{
name: 'code',
path: '/code',
meta:{
title:"",
sort:"",
},
component: resolve(__dirname, 'pages/code.vue'),
},
{
name: 'ceshi',
path: '/ceshi/:id',
meta:{
title:"测试",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/content/ceshi.vue'),
},
{
name: '',
path: '/',
// meta:{
// title:"首页",
// sort:"",
// },
// redirect:'index',
component: resolve(__dirname, 'pages/index.vue'),
children:[
{
name: 'index',
path: '/index',
meta:{
title:"首页",
sort:0
},
component: resolve(__dirname, 'pages/main/main.vue'),
},
{
name: 'gonggao',
path: '/gonggao',
meta:{
title:"公告",
sort:"",
},
component: resolve(__dirname, 'pages/main/gonggao.vue'),
},
{
name: 'dbcourse',
path: '/dbcourse',
meta:{
title:"点播课程",
sort:"",
},
component: resolve(__dirname, 'pages/main/course.vue'),
},
{
name: 'ppt',
path: '/ppt',
meta:{
title:"PPT课程",
sort:"",
},
component: resolve(__dirname, 'pages/main/ppt.vue'),
},
{
name: '/allCourse',
path: '/allCourse',
meta:{
title:"全部课程",
sort:"",
},
component: resolve(__dirname, 'pages/main/allCourse.vue'),
},
{
name: 'searchList',
path: '/searchList',
meta:{
title:"搜索列表",
sort:"",
},
component: resolve(__dirname, 'pages/main/searchList.vue'),
},
{
name: 'face_course',
path: '/face_course',
meta:{
title:"面授课程",
sort:"",
},
component: resolve(__dirname, 'pages/main/face.vue'),
},
{
name: 'news',
path: '/news',
meta:{
title:"新闻资讯",
sort:"",
},
component: resolve(__dirname, 'pages/main/news.vue'),
},
{
name: 'helpContent',
path: '/helpContent/:id',
meta:{
title:"帮助中心详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/news/helpContent.vue'),
},
{
name: 'indexNewsContent',
path: '/indexNewsContent/:id',
meta:{
title:"头条详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/news/indexNewsContent.vue'),
},
{
name: 'newsContent',
path: '/newsContent/:id',
meta:{
title:"公告详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/news/newsContent.vue'),
},
{
name: 'noticeContent',
path: '/noticeContent/:id',
meta:{
title:"新闻详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/news/noticeContent.vue'),
},
{
name: 'trainNewsContent',
path: '/trainNewsContent/:id',
meta:{
title:"新闻详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/news/trainNewsContent.vue'),
},
{
name: 'help',
path: '/help',
meta:{
title:"帮助中心",
sort:"",
},
component: resolve(__dirname, 'pages/main/help.vue'),
},
{
name: 'paper',
path: '/paper/:id1/:id2/:id3',
meta:{
title:"测试",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/content/paper.vue'),
},
{
name: 'helpContent',
path: '/help_content/:id',
meta:{
title:"详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/helpContent.vue'),
},
{
name: 'meal',
path: '/meal_course',
meta:{
title:"套餐课程",
sort:"",
},
component: resolve(__dirname, 'pages/main/meal.vue'),
},
{
name: 'order',
path: '/order/:id',
meta:{
title:"订单",
sort:"",
isLogin:true
},
component: resolve(__dirname, 'pages/content/order.vue'),
},
{
name: 'courserContent',
path: '/dbcourse_content/:id',
meta:{
title:"课程详情",
sort:"",
},
component: resolve(__dirname, 'pages/content/courseContent.vue'),
},
{
name: 'about',
path: '/about',
meta:{
title:"关于我们",
sort:""
},
component: resolve(__dirname, 'pages/main/about.vue'),
},
{
name: 'reg',
path: '/reg',
meta:{
title:"注册",
sort:""
},
component: resolve(__dirname, 'pages/login/reg.vue'),
},
{
name: 'forget',
path: '/forget',
meta:{
title:"找回密码",
sort:""
},
component: resolve(__dirname, 'pages/login/back.vue'),
}
]
},
)
}
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
'element-ui/lib/theme-chalk/index.css',
"swiper/swiper-bundle.css"
/**
* 配置全局 css
*/
],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
'@/plugins/element-ui',
//'@/plugins/core',
{src:'@/plugins/axios',ssr:true},
{src:'@/plugins/route',ssr:true},
{ src: '@/plugins/babel-polyfill', ssr: true },
{ src: '@/plugins/swiper.js', ssr: false },
{ src: '@/plugins/player.js', ssr: false },
{ src: '@/plugins/aliyun-webrtc-sdk.js', ssr: false },
{ src: '@/plugins/gl.js', ssr: false },
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
'@nuxtjs/axios',
],
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
transpile: [/^element-ui/,'installComponents'],
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery'
}),
],
extend(config, ctx) {
if(!ctx.isDev&&ctx.isClient){
config.plugins.push(
new TerserPlugin({
terserOptions: {
compress: {
drop_console: true,
drop_debugger:true
},
}
})
)
}
// config.module.rules.push({
// test: /\.(png|jpe?g|gif|svg|webp|hdr)(\?.*)?$/,
// loader: 'file-loader',
// options: {
// name: 'img/[name].[ext]'
// }
// },
// {
// test: /\.(hdr)$/i,
// use: [
// {
// loader: 'file-loader',
// options: {
// name: 'img/[name].[ext]'
// }
// }
// ]
// })
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化