Skip to content

Releases: Ser-Gen/postcss-data-packer

1.2.3

09 Jul 20:44
Compare
Choose a tag to compare
  • Change regexp to prevent catch filenames starts with data.

1.2.2

29 Dec 21:04
Compare
Choose a tag to compare
  • function in annotation of source map options will be working properly

Value of annotation must be string or boolean — https://github.com/postcss/postcss/blob/master/docs/source-maps.md#options
In previous release you will get only default value of annotation: opts.to + '.map'.
In this release function in annotation will execute in advance to get proper reslut.

1.2.1

15 Dec 09:12
Compare
Choose a tag to compare

Options of function in dest.map.annotation have become richer.
For example, now you can set filenames only in opts of postcss.process():

var fs = require('fs');
var path = require('path');

require('postcss')([
    require('postcss-data-packer')({
        dest: {
            path: function (opts) {
                return path.join(path.dirname(opts.to), path.basename(opts.to, '.css') + '.data.css');
            },
            map: {
                inline: false,
                annotation: function (dataOpts, opts) {
                    return path.join(path.dirname(opts.map.annotation), path.basename(dataOpts.to) +'.map');
                }
            }
        }
    })
])
.process(fs.readFileSync('_main.css'), {
    from: '_main.css',
    to: 'css/main.css',
    map: {
        inline: false,
        annotation: 'css/maps/main.css.map'
    }
})
.then(function (result) {

    fs.writeFileSync(result.opts.to, result.css);

    if ( result.map ) {
        fs.writeFileSync(result.opts.map.annotation, result.map);
    };

});

After executing you will get:

[cwd]
├── css
│   ├── maps
│   |   ├── main.css.map
│   |   └── main.data.css.map
│   ├── main.css
│   └── main.data.css
└── _main.css

1.2.0

14 Dec 21:05
Compare
Choose a tag to compare
  • If dest is defined and there is no data in processed file, then an empty file is not created (#13)
  • dest.path and dest.path.map.annotation could be defined as functions (#13)

1.1.0

26 Sep 18:57
Compare
Choose a tag to compare
  • Replace dataFile with dest as an option (#7)
  • Use PostCSS 5 API (#9)
  • Font-face rules without data must be removed from datafile (#10)
  • Pure must combine selectors not paying attention on quotes (#11)

1.0.6

13 Apr 17:14
Compare
Choose a tag to compare
  • Fix odd entity packing #8

1.0.5

08 Feb 11:48
Compare
Choose a tag to compare
  • Regexp using as variable
  • Added example of grunt setup in doc (#5)
  • Fix: default options

1.0.4

16 Jan 11:29
Compare
Choose a tag to compare

Fix for PostCSS API changes (#4)

1.0.3

05 Jan 21:58
Compare
Choose a tag to compare
  • Fix: removing unnecessary whitespaces

1.0.2

22 Dec 20:01
Compare
Choose a tag to compare
  • Add english translation of readme (#1)
  • Change name of plugin (#2)