Closed NN77 closed 8 years ago
Since the plugin is an ES6 module the code below should fix your issue.
import sprites from 'postcss-sprites'
Module ''postcss-sprites'' has no default export. (1192)
Try this
import sprites = require('postcss-sprites').default;
// or
import sprites = require('postcss-sprites');
Useful article about Typescript's import.
Still error, even though changing ts compilation to es6 in my tsconfig.
Cannot invoke an expression whose type lacks a call signature. (2349)
The support of Typescript was added in ff4fd90086c22cf634c8b0934ec7e376caf7c4d3(v3.1.2). So now you can use the plugin as shown below.
import sprites = require('postcss-sprites');
const PROCESSORS = [
...
sprites['default']({
stylesheetPath: `${TMP_DIR}/sprites`,
spritePath: `${TMP_DIR}/sprites`
})
];
The same situation with
but solution for TypeScript needed. Thanks in advance