question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why is brunch copying bower dependencies instead of compiling into vendor.js and app.css

See original GitHub issue

For one of my bower dependencies, the css and js file specified by its main declaration in its bower.json file are being copied straight to the output css and js directories, rather than being compiled into vendor.js and app.css.

All other bower dependencies are being compiled as expected. I’ve tried deleting the bower_components directory and reinstalling and deleting the public directory, but neither has helped.

I’m using brunch version 1.7.10

My config.coffee file looks like this:

exports.config =
  # See http://brunch.io/#documentation for docs.
  files:
    javascripts:
      joinTo:
        'js/app.js': /^(app)/
        'js/vendor.js': /^(bower_components)/
        'test/js/test.js': /^test(\/|\\)(?!bower_components)/
        'test/js/test-bower_components.js': /^test(\/|\\)(?=bower_components)/

    stylesheets:
      joinTo:
        'css/app.css' : /^(app|bower_components)/

    templates:
      joinTo: 'app.js'

  modules:
    nameCleaner: (path) ->
      path.replace(/^app\/scripts\//, '')

the main declaration for in the bower.json for the dependency that is copying instead of compiling looks like this:

  "main": [
    "./BS3/assets/js/datatables.js", 
    "./BS3/assets/css/datatables.css"
  ]

These two files just get copied straight, instead of compiled, and I can’t for the life of me figure out why these are behaving differently to all the other dependencies I have.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lukenscommented, Nov 25, 2013

Should this work (limits the assets match to just the app directory)?

  conventions:
    assets: /^(app(\/|\\)assets)/
0reactions
lukenscommented, Nov 25, 2013

That seems to have done the trick, many thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

import vendor css? · Issue #1669 · brunch/brunch - GitHub
Description I'm using brunch to process a css file provided in one of the node modules my project depends on. (Specifically, vue-material).
Read more >
Brunch Not Pulling in Bootstrap via bower.js - Stack Overflow
e.g. Bootstrap as bower dependency doesn't export .css stylesheet, instead it uses Less. Unfortunately brunch will not compile .less files ...
Read more >
Using Brunch | Book of Modern Front-end Tooling - Zeno Rocha
This is a free, work-in-progress open-source book introducing you to the world ... we tell Brunch that the app/assets folder should be copied...
Read more >
brunch/brunch - Gitter
i.e. app contains assets , front and some-stuff . All JS code is located it app/front/js and CSS is in app/front/css . Brunch...
Read more >
Using JS modules and NPM - Brunch.io
This is needed because brunch automatically compiles bower dependencies in right order. Note that overrides do not impact Bower's behavior, so the original ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found