learn_nuxt/packages/3-baseconfig
2023-05-04 15:42:44 +08:00
..
src 3 2023-05-04 15:42:44 +08:00
.gitignore 3 2023-05-04 15:42:44 +08:00
.npmrc 3 2023-05-04 15:42:44 +08:00
nuxt.config.ts 3 2023-05-04 15:42:44 +08:00
package.json 3 2023-05-04 15:42:44 +08:00
README.md 3 2023-05-04 15:42:44 +08:00
tsconfig.json 3 2023-05-04 15:42:44 +08:00

基础配置

自定义启动端口

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
    devServer: {
        port: 3000,
        host: "0.0.0.0"
    },
})

自定义样式

// https://nuxt.com/docs/api/configuration/nuxt-config
import { fileURLToPath } from "node:url";

export default defineNuxtConfig({
  srcDir: "src",
  devServer: {
    port: 3000,
    host: "0.0.0.0",
  },
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: '@import "@/style/index.scss";',
        },
      },
    },
  },
  alias: {
    "@": fileURLToPath(new URL("./src/", import.meta.url)),
  },
});