Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
23e1207
[Add] lodash dependency
loranger Jan 30, 2015
bf090e0
[Upg] Handle font files and enable options instead of bower function …
loranger Jan 30, 2015
1c3e41c
[Upg] Update readme
loranger Jan 30, 2015
1301bd1
[Fix] Readme markdown lists
loranger Jan 30, 2015
99c0403
[Fix] Use debugging instead of debug, as main-bower-files does
loranger Mar 4, 2015
5d3812a
[Fix] Handle woff2 fonts
loranger Mar 4, 2015
68bde13
[Upg] Add gulp-changed for fonts
loranger Mar 4, 2015
3a330cf
Add image support
tomgrv May 15, 2015
c010fc3
Update documentation
tomgrv May 15, 2015
457d507
Made all file types optional by checking for false value first.
EHLOVader May 15, 2015
0a011c0
[Upg] Add default config
tomgrv May 21, 2015
b1329da
[Upd] minify/uglify as options
Jun 29, 2015
62b4f27
Prepare current package for Elixir upgrade by pinning it to v2.x
EHLOVader Aug 17, 2015
5903a69
Update version of laravel elixir and bump major version of package fo…
EHLOVader Aug 17, 2015
3d696c7
Updated readme with optional example.
EHLOVader Sep 2, 2015
11fcdc3
Updaed with new elixir config and folder paths.
EHLOVader Sep 2, 2015
26c2660
Added new task system. Calling start on bower task.
EHLOVader Sep 2, 2015
512c039
Check for future posible font or img configurations before checking f…
EHLOVader Sep 2, 2015
07f0614
Merge branch 'optional-css-js' into elixir3 to include latest branch …
EHLOVader Sep 2, 2015
ad8d39b
Updated task and output folders for default config.
EHLOVader Sep 2, 2015
9458501
Merge pull request #1 from EHLOVader/elixir3
Oct 15, 2015
4d4248f
[Upd] Notifications
tomgrv Oct 20, 2015
3aba4c6
[Upd] Re-use laravel-elixir notification system
tomgrv Oct 20, 2015
4f9aa09
[Upd] Filesize usage
tomgrv Oct 21, 2015
fa881e0
[Upd] Rename bowerfile plugin
tomgrv Oct 21, 2015
1b89b1d
[Upd] Standardized notifications
tomgrv Oct 21, 2015
1bc30e4
[Add] Dependencies
tomgrv Oct 21, 2015
bd946cf
[Add] New packages
tomgrv Oct 21, 2015
5e37462
[Add] css rewrite support
tomgrv Oct 21, 2015
23a1714
[Add] assets structure management
tomgrv Oct 25, 2015
bdcc91d
[Crr] handle font url query string
Nov 9, 2015
09049e8
[Crr] Syntax
Dec 6, 2015
581b8d1
[Crr] Syntax
Dec 6, 2015
d79a12c
[Add] Flatten structure mode
tomgrv Dec 17, 2015
66c2ea7
[Add] Flatten structure mode
tomgrv Dec 17, 2015
ea1b34d
[Add] Flatten structure mode
tomgrv Dec 17, 2015
7e59cd0
[Add] Cssnano for css
tomgrv Jan 9, 2016
dc8967b
[Upd] dependencies
tomgrv Apr 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/
node_modules/
/nbproject/private/
/nbproject/
135 changes: 127 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,143 @@ laravel-elixir-bower

Elixir Wrapper Around Bower

```
### Usage

```javascript
var elixir = require('laravel-elixir');

require('laravel-elixir-bower');

elixir(function(mix) {
mix.bower()
.routes()
.events();
mix.bower();
});
```

This will :
- scan your bower files
- concat all css files in a `public/css/vendor.css` file
- concat all js files in a `public/js/vendor.js` file
- copy all webfonts in a `fonts/` folder.
- copy all images in a `imgs/` folder.

### Settings

The default settings are the following :

```javascript
{
debugging: false, // Enable/Disable verbose output
flatten: true, // Enable/Disable flat asset structure
css: {
file: 'vendor.css', // Merged CSS file
output: config.cssOutput // Elixir default css output folder (public/css)
},
js: {
file: 'vendor.js', // Merged JS file
output: config.jsOutput // Elixir default js output folder (public/js)
},
font: {
output: 'public/fonts' // Web fonts output folder
},
img: {
output: 'public/imgs',
extInline: ['gif','png'], // Extensions to inline
maxInlineSize: 32 * 1024 // [kB] Inline as data uri images below specified size
// (use 0 to disable, max 32k on ie8)
}
}
```

Each setting can be overwritten by passing them as an object to the `bower()` function.

Any setting can also be set to `false` to prevent generation and output of those files.

### Examples

```javascript
elixir(function(mix) {
mix.bower({
debugging: true,
css: {
file: 'plugins.css'
},
js: {
output: 'public/scripts'
}
});
});
```

This will scan your bower files and concat all css files, by default, in a `css/vendor.css` file. And all js files in a `js/vendor.js` file.
```javascript

var options = {};
options.debugging = true;
options.css = {file: 'plugins.css'};
options.js = {output: 'public/scripts'};

elixir(function(mix) {
mix.bower(options);
});
```

These settings can be overwriten by passing them to the `bower()` function.
Those examples do the same :
- scan your bower files
- concat all css files in a `public/css/plugins.css` file
- concat all js files in a `public/scripts/vendor.js` file
- copy all webfonts in a `fonts/` folder.

```javascript
elixir(function(mix) {
mix.bower({
debugging: true,
css: false,
js: false,
font: {
output: 'public/fonts'
},
img: {
output: 'public/css',
extInline: ['gif', 'png'], // Extensions to inline
maxInlineSize: 32 * 1024 // [kB] Inline as data uri images below specified size
// (use 0 to disable, max 32k on ie8)
}
});
});
```
This example does the following:
- scan your bower files
- skips css and js files
- copy all webfonts in a `public/fonts/` folder.
- copy all gif or png images into `public/css` folder.
- inline any of those images which are smaller than 32k.

```javascript
elixir(function(mix) {
mix.bower('styles.css', 'public/assets/css', 'scripts.js', 'public/assets/js');
mix.bower({
debugging: true,
flatten: false,
css: {
output: 'public/css'
},
js: false,
font: {
output: 'public/fonts'
},
img: {
output: 'public/imgs',
extInline: ['gif', 'png'], // Extensions to inline
maxInlineSize: 32 * 1024 // [kB] Inline as data uri images below specified size
// (use 0 to disable, max 32k on ie8)
}
});
});
```
```
This example does the following:
- scan your bower files
- deactivate flat asset mode
- concat all css files in a `public/css/plugins.css` file
- skips js files
- copy all webfonts in a `public/fonts/{bower_package}/xxx` folder (according to bower package structure)
- copy all gif or png images into `public/imgs/{bower_package}/xxx` folder (according to bower package structure)
- inline any of those images which are smaller than 32k.

Loading