rollup-plugin-less
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -74,24 +74,26 @@ 'use strict'; | ||
options.option['filename'] = id; | ||
_context.next = 8; | ||
options.output = options.output || 'rollup.build.css'; | ||
_context.next = 9; | ||
return renderSync(code, options.option); | ||
case 8: | ||
case 9: | ||
css = _context.sent; | ||
if (!(options.output && isFunc(options.output))) { | ||
_context.next = 13; | ||
_context.next = 14; | ||
break; | ||
} | ||
_context.next = 12; | ||
_context.next = 13; | ||
return options.output(css, id); | ||
case 12: | ||
case 13: | ||
css = _context.sent; | ||
case 13: | ||
case 14: | ||
if (options.output && isString(options.output)) { | ||
if (fileCount == 1) { | ||
//clean output file | ||
//clean the output file | ||
fs.removeSync(options.output); | ||
@@ -105,3 +107,3 @@ } | ||
if (options.insert) { | ||
if (options.insert != false) { | ||
exportCode = 'export default ' + injectFnName + '(' + _JSON$stringify(css.toString()) + ');'; | ||
@@ -116,8 +118,8 @@ } else { | ||
case 19: | ||
_context.prev = 19; | ||
case 20: | ||
_context.prev = 20; | ||
_context.t0 = _context['catch'](3); | ||
throw _context.t0; | ||
case 22: | ||
case 23: | ||
case 'end': | ||
@@ -127,3 +129,3 @@ return _context.stop(); | ||
} | ||
}, _callee, _this, [[3, 19]]); | ||
}, _callee, _this, [[3, 20]]); | ||
}))(); | ||
@@ -150,3 +152,2 @@ } | ||
module.exports = plugin; | ||
//# sourceMappingURL=rollup-plugin-less.js.map | ||
module.exports = plugin; |
{ | ||
"name": "rollup-plugin-less", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "a rollup plugin for less files", | ||
@@ -5,0 +5,0 @@ "main": "dist/rollup-plugin-less.js", |
@@ -11,3 +11,3 @@ ## Install | ||
import './test.less'; | ||
//generate css will be auto insert to the head tag | ||
//generate css will be auto insert to the head tag if you set insert be true | ||
``` | ||
@@ -39,2 +39,5 @@ | ||
+ Default: `rollup.build.css` | ||
+ Type: `String` | ||
+ Type: `String|Function` | ||
@@ -41,0 +44,0 @@ |
@@ -24,3 +24,3 @@ import babel from 'rollup-plugin-babel'; | ||
external: external, | ||
sourceMap: true | ||
sourceMap: false | ||
}; |
@@ -37,2 +37,4 @@ import fs from 'fs-extra'; | ||
options.option['filename'] = id; | ||
options.output = options.output || 'rollup.build.css'; | ||
let css = await renderSync(code, options.option); | ||
@@ -46,3 +48,3 @@ | ||
if(fileCount == 1){ | ||
//clean output file | ||
//clean the output file | ||
fs.removeSync(options.output); | ||
@@ -55,3 +57,3 @@ } | ||
if(options.insert){ | ||
if(options.insert!=false){ | ||
exportCode = `export default ${injectFnName}(${JSON.stringify(css.toString())});`; | ||
@@ -58,0 +60,0 @@ }else{ |
@@ -13,2 +13,5 @@ 'use strict'; | ||
return css; | ||
} | ||
} | ||
__$styleInject("body .wrap {\n color: #fff;\n}\nbody a {\n font-size: 12px;\n}\n"); | ||
__$styleInject(".hidden {\n display: none !important;\n}\n.content .header {\n font-size: 12px;\n}\n.content .body {\n color: #333;\n}\n"); |
@@ -28,5 +28,3 @@ var assert = require( 'assert' ); | ||
], | ||
plugins: [ less({ | ||
output: './style.css' | ||
}) ] | ||
plugins: [ less() ] | ||
}).then((bundle) => { | ||
@@ -33,0 +31,0 @@ bundle.write({ |
Sorry, the diff of this file is not supported yet
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
414
51
18344
19