brunch / brunch

:fork_and_knife: Web applications made easy. Since 2011.
https://brunch.io
MIT License
6.81k stars 436 forks source link

confused about conventions.assets #1822

Closed heyZeus closed 2 years ago

heyZeus commented 5 years ago

Description

I'm attempting to use the conventions.assets in the brunch-config.js and it doesn't seem to be working for me.

Expected behavior

I have static html files, img directory, etc in my brunch/assets directory that do not get copied over to the public directory. my brunch-config.js:

  conventions: {
    assets: /brunch\/assets\//
  }

I've also tried 'brunch/assets/*' as well. No dice. If I move the brunch/assets directory to my app/assets directory, the files are copied into public.

If I cp the files from brunch/assets/ to the public folder on the command line it works just fine.

Actual behavior

Nothing is copied from brunch/assets to public

Environment

  1. Brunch: 2.10.0
  2. Node.js: 10.9.0
  3. NPM:
  4. Operating system: alpine linux
  5. Code editor: vim

brunch config contents

module.exports = {
  conventions: {
    assets: /\/brunch\/assets\//
  },
  paths: {
    public: '/home/cep/brunch/public'
  },
  files: {
    javascripts: {
      joinTo: {
        'js/app.js': /^app/,
        'js/vendor.js': /^(?!app)/
      },
      order: {
        before: [
          "vendor/js/underscore.js",
          "vendor/js/jquery.js",
          "vendor/js/backbone.js",
          "app/js/config/**.coffee",
          "app/js/core/**.coffee",
          "app/js/api/**.coffee",
          "app/js/models/**.coffee",
          "app/js/cgj_backbone_collection.coffee",
          "app/js/collections/**.coffee"
        ],
        after: ["app/js/app.coffee"]
      }
    },
    stylesheets: {
      joinTo: 'css/app.css'
    }
  },
  modules: {
     wrapper: (path, data) => {
      return `
(function() {
  ${data}
}).call(this);
`
    }
  },
  plugins: {
    handlebars: {
      namespace: 'JST'
    }
  },
};
astery commented 5 years ago

I think I'm experiencing the same. Found that it works when you specify this folder also in paths: {watched: ["special_folder"]}, but I don't want to my 10k files being watched.

astery commented 5 years ago

In my case, I've just copied needed assets using copycat-brunch plugin.