grunt-rollup
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "grunt-rollup", | ||
"description": "Grunt plugin for rollup - next-generation ES6 module bundler", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/chrisprice/grunt-rollup", | ||
@@ -26,6 +26,6 @@ "author": { | ||
"devDependencies": { | ||
"grunt": "^0.4.5", | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-contrib-nodeunit": "^0.4.1" | ||
"grunt-contrib-nodeunit": "^1.0.0" | ||
}, | ||
@@ -40,5 +40,5 @@ "peerDependencies": { | ||
"dependencies": { | ||
"es6-promise": "^3.0.2", | ||
"bluebird": "^3.3.4", | ||
"rollup": "^0.x" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # grunt-rollup | ||
## Getting Started | ||
This plugin requires Grunt `~0.4.5` | ||
This plugin requires Grunt `>=0.4.0` | ||
@@ -64,3 +64,3 @@ If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: | ||
###Usage with Plugins | ||
### Usage with Plugins | ||
@@ -73,6 +73,6 @@ ```js | ||
options: { | ||
plugins: [ | ||
babel({ | ||
exclude: './node_modules/**' | ||
}) | ||
plugins: [ | ||
babel({ | ||
exclude: './node_modules/**' | ||
}) | ||
] | ||
@@ -88,2 +88,30 @@ }, | ||
#### Plugin getter | ||
Some plugins are stateful and this doesn't play nice with multiple bundles. For example the `rollup-plugin-babel` plugin keeps a track of used `babel` helpers, and passing the configured plugin only once will cause the helpers to leak from one bundle to another. To prevent that, pass a function that returns an array of plugins, like this: | ||
```js | ||
var babel = require('rollup-plugin-babel'); | ||
grunt.initConfig({ | ||
rollup: { | ||
options: { | ||
plugins: function() { | ||
return [ | ||
babel({ | ||
exclude: './node_modules/**' | ||
}) | ||
]; | ||
} | ||
}, | ||
files: { | ||
'dest/bundle.js': 'src/entry.js', | ||
'dest/bundle2.js': 'src/entry2.js', | ||
}, | ||
}, | ||
}); | ||
``` | ||
This way the plugin will be refreshed for each bundle. | ||
## Contributing | ||
@@ -90,0 +118,0 @@ In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). |
@@ -11,3 +11,3 @@ /* | ||
var Promise = require('es6-promise').Promise; | ||
var Promise = require('bluebird').Promise; | ||
var rollup = require('rollup'); | ||
@@ -24,3 +24,3 @@ var path = require('path'); | ||
external: [], | ||
format: 'es6', | ||
format: 'es', | ||
exports: 'auto', | ||
@@ -48,10 +48,18 @@ moduleId: null, | ||
var entry; | ||
if (f.src.length > 1) { | ||
grunt.fail.warn('Multiple entry points are not supported.'); | ||
entry = f.src; | ||
grunt.log.writeln('Multiple entry points detected. Be sure to include rollup-plugin-multi-entry in plugins.'); | ||
} else { | ||
entry = f.src[0]; | ||
if (!grunt.file.exists(entry)) { | ||
grunt.fail.warn('Entry point "' + entry + '" not found.'); | ||
} | ||
} | ||
var entry = f.src[0]; | ||
var plugins = options.plugins; | ||
if (!grunt.file.exists(entry)) { | ||
grunt.fail.warn('Entry point "' + entry + '" not found.'); | ||
if (typeof plugins === 'function') { | ||
plugins = plugins(); | ||
} | ||
@@ -62,3 +70,5 @@ | ||
external: options.external, | ||
plugins : options.plugins | ||
plugins: plugins, | ||
context: options.context, | ||
moduleContext: options.moduleContext | ||
}).then(function(bundle) { | ||
@@ -65,0 +75,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9896
9
97
122
+ Addedbluebird@^3.3.4
+ Addedbluebird@3.7.2(transitive)
- Removedes6-promise@^3.0.2
- Removedes6-promise@3.3.1(transitive)