ember-cli / ember-cli/broccoli-asset-rev

/assets/ hardcoded in various places

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
86
Forks
79
PR merge metrics
No merged PRs in 30d

Description

The Broccoli walkthrough puts assets in `app/`, but `broccoli-asset-rev` assumes that many things will be in `assets/`, as well as having defaults (for manifest/assetMap files) there. The following seem to be affected:
- filter controlling which files in the asset map are written to the Rails/Sprockets-compatible manifest
- location of existing Rails manifest

The second I'm (a) not hugely fussed about, and (b) don't know how to trigger given Broccoli doesn't want to overwrite build trees. But the first means that something like the following (which may not be the "right" way of doing things, but doesn't give errors) misses `app.css` and `app.js` from the Rails manifest:

``` javascript
/* Brocfile.js */

// Import some Broccoli plugins
var compileSass = require('broccoli-sass');
var filterCoffeeScript = require('broccoli-coffee');
var mergeTrees = require('broccoli-merge-trees');
var rev = require('broccoli-asset-rev');

// Specify the Sass and Coffeescript directories
var sassDir = 'app/scss';
var coffeeDir = 'app/coffeescript';

// Tell Broccoli how we want the assets to be compiled
var styles = compileSass([sassDir], 'app.scss', 'app.css');
var scripts = filterCoffeeScript(coffeeDir);
// Merge the compiled styles and scripts into one output directory.
var tree = mergeTrees([styles, scripts]);

var hashed = new rev(
tree,
{
generateAssetMap: true,
generateRailsManifest: true,
railsManifestPath: 'manifest.json',
}
);

module.exports = hashed;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.