antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite
MIT License
1.31k stars 134 forks source link

css selectors not support #333

Open yejinjian opened 1 year ago

yejinjian commented 1 year ago

Describe the bug

I use last vitesse example whit ant-desigin-vue which run success in vite dev but get an error in build

 xxxxx\node_modules\ant-design-vue\lib\style\default.css:5
[class^=ant-]::-ms-clear,
      ^^

SyntaxError: Unexpected token '^='
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1084:15)
    at Module._compile (node:internal/modules/cjs/loader:1119:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19)
    at require (node:internal/modules/cjs/helpers:103:18)

Reproduction

lastest vitesss + antdv + AntDesignVueResolver

System Info

System:
    OS: Windows 10 10.0.22623
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
    Memory: 2.39 GB / 15.36 GB
  Binaries:
    Node: 16.18.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.2.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.870.0), Chromium (110.0.1587.41)
    Internet Explorer: 11.0.22621.1

Used Package Manager

yarn

Validations

hershelh commented 1 year ago

You can try this:

// vite.config.ts

export default defineConfig({
  // ...,

  ssr: {
    noExternal: [‘ant-design-vue’],
  },
})