代码之家  ›  专栏  ›  技术社区  ›  bensiu CandorZ

在nuxtjs中提取css生成

  •  1
  • bensiu CandorZ  · 技术社区  · 6 年前

    nuxt generate

    1 回复  |  直到 6 年前
        1
  •  6
  •   HexXx    6 年前

    nuxt.config.js文件

    module.exports = {
      build: {
        extractCSS: true
      }
    }
    

    here

    如果要全局导入CSS文件,请使用

    module.exports = {
      css: [
        // Load a Node.js module directly (here it's a Sass file)
        'bulma',
        // CSS file in the project
        '@/assets/css/main.css',
        // SCSS file in the project
        '@/assets/css/main.scss'
      ]
    }
    

    如文件所示 here