svelte-preprocess
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -7,2 +7,10 @@ ### Changelog | ||
#### [v2.3.1](https://github.com/kaisermann/svelte-preprocess/compare/v2.2.2...v2.3.1) | ||
> 1 September 2018 | ||
- Add support for passing specific options to language aliases [`a52106b`](https://github.com/kaisermann/svelte-preprocess/commit/a52106b6da3bdd3ed18d711e77aad26dc5d73e37) | ||
- Add default options for aliased languages [`975b08f`](https://github.com/kaisermann/svelte-preprocess/commit/975b08f60ce0ef5d3c9a0ff3caa49949e967b274) | ||
- Show postcss error message [`38c6b1f`](https://github.com/kaisermann/svelte-preprocess/commit/38c6b1fe7af1f808fd22f7a77cf6c9f3e8813b2b) | ||
#### [v2.2.2](https://github.com/kaisermann/svelte-preprocess/compare/v2.2.1...v2.2.2) | ||
@@ -14,15 +22,10 @@ | ||
#### [v2.2.1](https://github.com/kaisermann/svelte-preprocess/compare/v2.2.0...v2.2.1) | ||
#### [v2.2.1](https://github.com/kaisermann/svelte-preprocess/compare/v2.1.4...v2.2.1) | ||
> 18 July 2018 | ||
- Use postcss-load-config instead of cosmiconfig [`21f72d5`](https://github.com/kaisermann/svelte-preprocess/commit/21f72d52f05f72e8a44ab2ecce690dd8efac52c4) | ||
- Add changelog [`332e64f`](https://github.com/kaisermann/svelte-preprocess/commit/332e64f277601eb4d2f2ab66ec3a98f03bc42b85) | ||
- Prioritize manual postcss config over config file [`05bb64e`](https://github.com/kaisermann/svelte-preprocess/commit/05bb64e543521524e0bdb10306a5a2ba94149a48) | ||
#### [v2.2.0](https://github.com/kaisermann/svelte-preprocess/compare/v2.1.4...v2.2.0) | ||
> 17 July 2018 | ||
- Use postcss-load-config instead of cosmiconfig [`21f72d5`](https://github.com/kaisermann/svelte-preprocess/commit/21f72d52f05f72e8a44ab2ecce690dd8efac52c4) | ||
#### [v2.1.4](https://github.com/kaisermann/svelte-preprocess/compare/v2.1.3...v2.1.4) | ||
@@ -29,0 +32,0 @@ |
{ | ||
"name": "svelte-preprocess", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"license": "MIT", | ||
"main": "src/index.js", | ||
"types": "src/index.d.ts", | ||
"description": "A Svelte preprocess wrapper with baked in support for some preprocessors", | ||
"description": "A Svelte preprocessor wrapper with baked in support for common used preprocessors", | ||
"author": "Christian Kaisermann <christian@kaisermann.me>", | ||
@@ -9,0 +9,0 @@ "repository": "https://github.com/kaisermann/svelte-preprocess", |
const coffeescript = require('coffeescript') | ||
module.exports = function({ content, filename, opts }) { | ||
module.exports = function({ content, filename, options }) { | ||
const { js: code, sourceMap: map } = coffeescript.compile(content, { | ||
filename, | ||
sourceMap: true, | ||
...opts, | ||
...options, | ||
}) | ||
@@ -9,0 +9,0 @@ |
const less = require('less/lib/less-node') | ||
module.exports = function({ content, filename, opts }) { | ||
module.exports = function({ content, filename, options }) { | ||
return less | ||
.render(content, { | ||
sourceMap: {}, | ||
...opts, | ||
...options, | ||
}) | ||
@@ -9,0 +9,0 @@ .then(output => ({ |
@@ -16,6 +16,6 @@ const postcss = require('postcss') | ||
/** Adapted from https://github.com/TehShrike/svelte-preprocess-postcss */ | ||
module.exports = ({ content, filename, options = {}, map = undefined }) => { | ||
module.exports = ({ content, filename, options, map = undefined }) => { | ||
/** If manually passed a plugins array, use it as the postcss config */ | ||
return typeof options.plugins !== 'undefined' | ||
? process(options.plugins || [], content, filename, map) | ||
? process(options.plugins, content, filename, map) | ||
: /** If not, look for a postcss config file */ | ||
@@ -22,0 +22,0 @@ postcssLoadConfig(options, options.configFilePath) |
const pug = require('pug') | ||
module.exports = function({ content, filename, options }) { | ||
options = { | ||
doctype: 'html', | ||
filename, | ||
...options, | ||
} | ||
const code = pug.render(content, options) | ||
return { code } | ||
} |
@@ -5,9 +5,8 @@ const sass = require('node-sass') | ||
module.exports = function({ | ||
content, | ||
filename, | ||
module.exports = function({ content, filename, options }) { | ||
options = { | ||
includePaths: getIncludePaths(filename), | ||
}, | ||
}) { | ||
...options, | ||
} | ||
return new Promise((resolve, reject) => { | ||
@@ -14,0 +13,0 @@ sass.render( |
@@ -5,9 +5,8 @@ const stylus = require('stylus') | ||
module.exports = function({ | ||
content, | ||
filename, | ||
module.exports = function({ content, filename, options }) { | ||
options = { | ||
paths: getIncludePaths(filename), | ||
}, | ||
}) { | ||
includePaths: getIncludePaths(filename), | ||
...options, | ||
} | ||
return new Promise((resolve, reject) => { | ||
@@ -14,0 +13,0 @@ const style = stylus(content, { |
@@ -87,5 +87,5 @@ const { readFileSync } = require('fs') | ||
exports.runTransformer = (name, maybeFn, { content, filename }) => { | ||
if (exports.isFn(maybeFn)) { | ||
return maybeFn({ content, filename }) | ||
exports.runTransformer = (name, options, { content, filename }) => { | ||
if (exports.isFn(options)) { | ||
return options({ content, filename }) | ||
} | ||
@@ -98,4 +98,2 @@ | ||
const options = typeof maybeFn === 'object' ? maybeFn : {} | ||
return transformers[name]({ content, filename, options }) | ||
@@ -102,0 +100,0 @@ } catch (e) { |
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
20357