nuxt / vite

⚡ Vite Experience with Nuxt 2

Home Page:https://vite.nuxtjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicative style in browser after build and run 'yarn start'

davinma opened this issue · comments

commented

Versions

nuxt-vite: ^0.3.5
nuxt: ^2.15.8

Reproduction

  • package.json
{
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "@nuxtjs/composition-api": "^0.32.0",
    "@types/qs": "^6.9.7",
    "@vueuse/core": "^9.2.0",
    "cookie-universal-nuxt": "^2.2.1",
    "core-js": "^3.19.3",
    "dayjs": "^1.11.5",
    "lodash-es": "^4.17.21",
    "nuxt": "^2.15.8",
    "postcss-preset-env": "7.8.0",
    "qs": "^6.11.0",
    "vue": "^2.6.14",
    "vue-server-renderer": "^2.6.14",
    "vue-template-compiler": "^2.6.14"
  },
  "devDependencies": {
    "@commitlint/cli": "^17.0.3",
    "@commitlint/config-conventional": "^17.0.3",
    "@nuxt/types": "^2.15.8",
    "@nuxt/typescript-build": "^2.1.0",
    "@nuxt/typescript-runtime": "^2.1.0",
    "@nuxtjs/device": "^2.1.0",
    "@types/lodash-es": "^4.17.6",
    "@typescript-eslint/eslint-plugin": "^5.30.4",
    "@typescript-eslint/parser": "^5.30.4",
    "@vue/eslint-config-prettier": "^7.0.0",
    "@vue/eslint-config-typescript": "^11.0.0",
    "eslint": "^8.18.0",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-unused-imports": "^2.0.0",
    "eslint-plugin-vue": "^9.1.1",
    "husky": "^8.0.0",
    "lint-staged": "^13.0.3",
    "nuxt-compress": "^5.0.0",
    "nuxt-vite": "^0.3.5",
    "nuxt-windicss": "^2.5.1",
    "prettier": "^2.7.1",
    "vue-template-babel-compiler": "^1.2.0"
  },
}
  • nuxt.config.ts
import { NuxtConfig } from '@nuxt/types'

const config: NuxtConfig = {
  build: {
    extractCSS: process.env.NODE_ENV === 'production'
  },
  vite: {
    build: {
      sourcemap: true
    }
  }
}

export default config

Description

After run yarn build and yarn start:
image
Duplicative style content in the /_nuxt/client.f50599f7.css file and the style tag:
image
Looks extractCSS not working, and it would be best to remove /_nuxt/client.f50599f7.css file.

commented

Run yarn dev is OK.

commented

Remove extractCSS looks fine now.