rollup-plugin-css-only
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -7,23 +7,20 @@ # Changelog | ||
## [2.0.0] - 2019-12-21 | ||
### Added | ||
- Add `bundle` as 3rd argument in `output` function @lazyhero | ||
### Changed | ||
- Replace mkdirp by fs.mkdir (Node.js 10.12+) @MichaelAllenHardeman | ||
## [1.0.0] - 2019-01-27 | ||
### Update | ||
- Update `ongenerate` to `generateBundle` | ||
## [0.6.0] - 2017-08-21 | ||
### Added | ||
- Close server when rollup exits | ||
- Add ES modules build: `dist/index.es.js` | ||
### Fixed | ||
- Close server when rollup exits | ||
- Inject script tag non-blocking | ||
### Changed | ||
- Migrate to Rollup v1 @tlvince | ||
## [0.4.0] - 2016-12-05 | ||
### Added | ||
- Accept array to watch for changes | ||
[Unreleased]: https://github.com/thgh/rollup-plugin-livereload/compare/v1.0.0...HEAD | ||
[1.0.0]: https://github.com/thgh/rollup-plugin-livereload/compare/v0.6.0...v1.0.0 | ||
[0.6.0]: https://github.com/thgh/rollup-plugin-livereload/compare/v0.4.0...v0.6.0 | ||
[0.4.0]: https://github.com/thgh/rollup-plugin-livereload/compare/v0.0.1...v0.4.0 | ||
[0.0.1]: https://github.com/thgh/rollup-plugin-livereload/releases | ||
[Unreleased]: https://github.com/thgh/rollup-plugin-css-only/compare/v2.0.0...HEAD | ||
[2.0.0]: https://github.com/thgh/rollup-plugin-css-only/compare/v1.0.0...v2.0.0 | ||
[1.0.0]: https://github.com/thgh/rollup-plugin-css-only/compare/v0.0.1...v1.0.0 | ||
[0.0.1]: https://github.com/thgh/rollup-plugin-css-only/releases |
@@ -8,3 +8,2 @@ 'use strict'; | ||
var path = _interopDefault(require('path')); | ||
var mkdirp = _interopDefault(require('mkdirp')); | ||
@@ -43,3 +42,3 @@ function css(options) { | ||
}, | ||
generateBundle: function generateBundle(opts) { | ||
generateBundle: function generateBundle(opts, bundle) { | ||
// No stylesheet needed | ||
@@ -59,3 +58,3 @@ if (!changes || options.output === false) { | ||
if (typeof options.output === 'function') { | ||
options.output(css, styles); | ||
options.output(css, styles, bundle); | ||
return | ||
@@ -85,10 +84,9 @@ } | ||
// Emit styles to file | ||
return new Promise(function(resolve, reject) { | ||
return new Promise(function (resolve, reject) { | ||
var ref = path.parse(dest); | ||
var dir = ref.dir; | ||
mkdirp(dir, function (err) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
fs.promises | ||
.mkdir(dir, { recursive: true }) | ||
.then(function () { | ||
fs.writeFile(dest, css, function (err) { | ||
@@ -101,4 +99,6 @@ if (err) { | ||
}); | ||
} | ||
}); | ||
}) | ||
.catch(function (err) { | ||
reject(err); | ||
}); | ||
}) | ||
@@ -105,0 +105,0 @@ } |
@@ -1,5 +0,4 @@ | ||
import { writeFile } from 'fs'; | ||
import { promises, writeFile } from 'fs'; | ||
import { createFilter } from 'rollup-pluginutils'; | ||
import path from 'path'; | ||
import mkdirp from 'mkdirp'; | ||
@@ -38,3 +37,3 @@ function css(options) { | ||
}, | ||
generateBundle: function generateBundle(opts) { | ||
generateBundle: function generateBundle(opts, bundle) { | ||
// No stylesheet needed | ||
@@ -54,3 +53,3 @@ if (!changes || options.output === false) { | ||
if (typeof options.output === 'function') { | ||
options.output(css, styles); | ||
options.output(css, styles, bundle); | ||
return | ||
@@ -80,10 +79,9 @@ } | ||
// Emit styles to file | ||
return new Promise(function(resolve, reject) { | ||
return new Promise(function (resolve, reject) { | ||
var ref = path.parse(dest); | ||
var dir = ref.dir; | ||
mkdirp(dir, function (err) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
promises | ||
.mkdir(dir, { recursive: true }) | ||
.then(function () { | ||
writeFile(dest, css, function (err) { | ||
@@ -96,4 +94,6 @@ if (err) { | ||
}); | ||
} | ||
}); | ||
}) | ||
.catch(function (err) { | ||
reject(err); | ||
}); | ||
}) | ||
@@ -100,0 +100,0 @@ } |
{ | ||
"name": "rollup-plugin-css-only", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Rollup plugin that bundles imported css", | ||
@@ -31,2 +31,5 @@ "main": "dist/index.cjs.js", | ||
], | ||
"engines": { | ||
"node": ">=10.12.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -36,3 +39,2 @@ "rollup": "^1.0.0" | ||
"dependencies": { | ||
"mkdirp": "^0.5.1", | ||
"rollup-pluginutils": "^2.3.3" | ||
@@ -39,0 +41,0 @@ }, |
# Rollup plugin that bundles imported css | ||
### Integrates nicely with rollup-plugin-vue2 | ||
<a href="LICENSE"> | ||
@@ -24,2 +22,5 @@ <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="Software License" /> | ||
npm install --save-dev rollup-plugin-css-only | ||
# If using Node.js lower than 10.12 | ||
npm install --save-dev rollup-plugin-css-only@1 | ||
``` | ||
@@ -59,3 +60,3 @@ | ||
// Filename to write all styles to | ||
output: 'bundle.scss', | ||
output: 'bundle.css', | ||
@@ -66,3 +67,3 @@ // Callback that will be called ongenerate with two arguments: | ||
output: function (styles, styleNodes) { | ||
writeFileSync('bundle.scss', styles) | ||
writeFileSync('bundle.css', styles) | ||
}, | ||
@@ -69,0 +70,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
10770
2
104
- Removedmkdirp@^0.5.1
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)