1 Star 0 Fork 1

拼却/nuxt2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nuxt.config.js 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
拼却 提交于 2024-01-12 18:13 . fix: 新增meta标签,优化seo
import path from 'node:path'
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'nuxt2',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'description', content: '这是一个自己搭建的SSR框架' },
{ name: 'keywords', contetn: 'Nuxt' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['element-ui/lib/theme-chalk/index.css', '~/static/style/base.less'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: ['@/plugins/element-ui', { src: '@/plugins/icons', ssr: true }],
// 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: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: [/^element-ui/],
extend(config, ctx) {
const svgRule = config.module.rules.find((rule) => rule.test.test('.svg'))
svgRule.exclude = [path.resolve(__dirname, 'static/image/svgIcon')]
config.module.rules.push({
test: /\.svg$/,
include: [path.resolve(__dirname, 'static/image/svgIcon')],
loader: 'svg-sprite-loader',
options: {
symbolId: 'icon-[name]',
},
})
},
},
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lu972982286/nuxt2.git
git@gitee.com:lu972982286/nuxt2.git
lu972982286
nuxt2
nuxt2
master

搜索帮助