Install Bower components into two different directories?

后端 未结 3 624
一个人的身影
一个人的身影 2021-01-30 17:43

When using CSS and JS components, is it possible, or even, does it make sense to install them to different directories?

.
|-- app
    |-- scripts
        |-- com         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 18:28

    There is a node package called bower-installer that provides a single command for managing alternate install paths.

    run npm install -g bower-installer

    Set up your bower.json

    {
      "name" : "test",
      "version": "0.1",
      "dependencies" : {
        "jquery-ui" : "latest"
      },
      "install" : {
        "path" : {
          "css": "src/css",
          "js": "src/js"
        },
        "sources" : {
          "jquery-ui" : [
            "components/jquery-ui/ui/jquery-ui.custom.js",
            "components/jquery-ui/themes/start/jquery-ui.css"
          ]
        }
      }
    }
    

    Then run bower-installer command.

    This will install components/jquery-ui/themes/start/jquery-ui.css to ./src/css, etc

提交回复
热议问题