Skip to content

When using --uncssrc it always fails #468

@pamtbaau

Description

@pamtbaau

When I use npx uncss -u uncss.json http://base-dev > ../css/style-uncssed.css, no matter the content of uncss.json a whole bunch of data is dumped and ../css/style-uncssed.css remains empty.

This is the tail of the dump:

          '@media (min-width: 576px) {\n' +
          '  .container-sm, .container {\n' +
          '    max-width: 540px;\n' +
          '  }\n' +
          '}\n' +
          '@media (min-width: 768px) {\n' +
          '  .co'... 197814 more characters,
        hasBOM: false,
        id: '<input css 1>'
      },
      end: { line: 64, column: 1 }
    },
    selector: ':root',
    lastEach: 1,
    indexes: {}
  }
}

Node.js v17.1.0

I've tried the following contents in uncss.json

{}

or

{
   "media": [
        "(max-width: 480px) and (orientation: landscape)"
    ]
}

or

{
    "media": [
        "(max-width: 480px)"
    ]
}

Whenever I run npx uncss -m "(max-width: 480px) and (orientation: landscape)" http://base-dev > ../css/style-uncssed.css, all goes well.

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions