【问题标题】:Brunch + Less + Bootstrap早午餐 + 少 + 引导
【发布时间】:2019-01-04 14:35:39
【问题描述】:

我在 Brunch 中使用 Less,但我的 boostrap/font-awesome 插件无法正常工作。 我的目标是使用 Bootstrap 和 Font-Awesome 作为节点模块。

exports.config = {
   // See http://brunch.io/#documentation for docs.
     files: {
       javascripts: {
      joinTo: "js/app.js"
    },
    stylesheets: {
      joinTo: "css/app.css",
     order: {
       after: ["web/static/css/app.less"] // concat app.css last
     }
    },
    templates: {
      joinTo: "js/app.js"
    }
  },
  conventions: {
    assets: /^(web\/static\/assets)/
  },

  // Phoenix paths configuration
  paths: {
    public: "../priv/static"
  },

  // Configure your plugins
  plugins: {
    babel: {
        presets: ["env", "react"],
      ignore: [/(web\/static\/vendor)|node_modules/]
    },
    less: {
      options: {
        paths: ["node_modules/font-awesome/less", "node_modules/bootstrap/less"]
       }
     },
     copycat: {
       "fonts" : ["static/fonts", "node_modules/font-awesome/fonts"],
       verbose : false, 
       onlyChanged: true 
     }
  },

  modules: {
    autoRequire: {
      "js/app.js": ["js/app"]
    }
  },

  npm: {
    enabled: true,
    globals: {
        $: 'jquery',
        jQuery: 'jquery',
        React: 'react',
        bootstrap: 'bootstrap',
        Tether: 'tether',
        Popper: 'popper.js',
      },
   }
   }

我的 app.less 文件有导入:

@import 'font-awesome';
@import "bootstrap.less";

但我不断收到错误bootstrap.less' was not found。我该如何解决这个问题?

【问题讨论】:

    标签: twitter-bootstrap less brunch


    【解决方案1】:

    我改用 sass,这让它变得容易多了……但是这个问题仍然存在。

    【讨论】:

      猜你喜欢
      • 2018-08-27
      • 2016-01-19
      • 1970-01-01
      • 2018-05-07
      • 2014-05-08
      • 2013-11-10
      • 2015-09-03
      • 2016-05-15
      • 2016-05-24
      相关资源
      最近更新 更多