【问题标题】:Nuxt and Bootstrap vue css in html headhtml 头中的 Nuxt 和 Bootstrap vue css
【发布时间】:2018-06-24 10:30:16
【问题描述】:

由于某种原因,当我在 heroku 上推送我的项目时,引导 css 像这样包含在头部中

<head>
<title></title>
(..)
<style data-vue-ssr-id="90433b46:0 8b4ab2e8:0 2c8d02e5:0 396e4108:0 01194ca0:0 203df954:0 0323c590:0 5ebbc628:0 7e87bec3:0">/*!
--
  | * Bootstrap v4.1.1 (https://getbootstrap.com/)
  | * Copyright 2011-2018 The Bootstrap Authors
  | * Copyright 2011-2018 Twitter, Inc.
  | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  | */*,:after,:before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent
(..)

我在这里做错了吗?

我已将 NPM_CONFIG_PRODUCTION 设置为 true,并将 NODE_ENV 设置为生产环境。

我包含它的方式与文档相同

modules: [
        'bootstrap-vue/nuxt',
        '@nuxtjs/axios',

(...)

我理解为什么在使用 npm run watch 进行热重载时会发生这种情况,但是在生产中我希望将 css 放在一个外部文件中,该文件将像任何其他 css 一样包含在内(带有 )

有什么想法吗?

【问题讨论】:

    标签: twitter-bootstrap vue.js nuxt.js


    【解决方案1】:

    您正在寻找extractCSS 配置属性。见docs

    【讨论】:

    • 你是对的。谢谢!有什么办法只能提取引导 css?
    猜你喜欢
    • 2019-10-01
    • 2018-08-23
    • 2018-10-25
    • 2019-10-27
    • 2021-04-05
    • 2019-01-04
    • 2019-05-03
    • 2019-10-10
    • 2021-06-25
    相关资源
    最近更新 更多