cssnext-loader icon indicating copy to clipboard operation
cssnext-loader copied to clipboard

Wrong behavior on empty css file

Open asafyish opened this issue 9 years ago • 3 comments

Hi,

I have a working setup with cssnext-loader, but if I require an empty css file, instead of getting an empty string, I am getting a json object.

The problem is at line 30 in index.js:

if (result.css)

should be

if (typeof result.css !== 'undefined')

because result.css is empty, and that's correct, but the check assume there was an error. If you want, I can make a PR for that.

asafyish avatar Dec 16 '15 07:12 asafyish

cssnext-loader will be deprecated, soon, you should consider using postcss-loader + postcss-cssnext plugin.

MoOx avatar Dec 16 '15 07:12 MoOx

Oh. Didn't know that :(

asafyish avatar Dec 16 '15 07:12 asafyish

I will keep that issue open so people will see it if they got an issue. Will close if someone fix it or when npm package will be deprecated.

MoOx avatar Dec 16 '15 07:12 MoOx