SassNinja / postcss-extract-media-query

PostCSS plugin to extract all media query from CSS and emit as separate files.
MIT License
130 stars 20 forks source link

media css files generated but default.css missing #26

Open jwamsterdam opened 4 years ago

jwamsterdam commented 4 years ago

Hi,

I am running postcss-extract-media-query as a standalone node js instance, and all my media query css files are created.

I dont see the 'default.css' file with the leftovers on my file system.

hereby my code:

const options = {
    output: {
        path: path.join(__dirname), // emit to 'dist' folder in root
        name: '[name]-[query].[ext]' // pattern of emited files
    }
};

fs.readFile('raw_css.css', 'utf8', function (err, data) {
    if (err) {
        return console.log(err);
    }

    postcss([extractmq(options)]).process(data).then(result => {
            console.log('new css file written')
        });      
    })

can you give me advice?

btw, since I would like to futher process the results, how can I store the results in an object instead of file system? I don't use webpack, I extract css from an url and parse in your code.

Thanks a lot!

erichstark commented 4 years ago

Any update on this? I have the same problem even with webpack integration.