`default` property `undefined` in 5.0.0
sindresorhus opened this issue · comments
I use it to get the default browsers.
console.log(require('autoprefixer-core').default);
//=> undefined
Yeap, because it was moved to Browserslist.
Use:
require('browserslist').defaults
I can move it back o Autoprefixer (as alias to Browserslist) if there is some user case for it.
It's useful so I don't have to manually match browserlist
version with the autoprefixer-core
version to be sure I get the same result.
It should also have been mention in the changelog as breaking change.
Done 3c1f9b5
In what case you need autoprefixer.defaults
? Maybe it will be better just miss browsers
option?
In what case you need autoprefixer.defaults?
I'm defining default options for atom-autoprefixer: https://github.com/sindresorhus/atom-autoprefixer/blob/5dfe8c0fdc0a6c64b807ffd4232aeb05c401a0c8/index.js#L44
Maybe it will be better just miss browsers option?
Hmm, not sure what you're asking?
If you will browsers
option, Autoprefixer will use default value. So you doesn't need to set it manually.
The default value is shown in the settings UI in Atom so users can edit it directly. That's why I need the value and the browsers
option defaulting isn't very useful for that.
OK, I add task in main repo: postcss/autoprefixer#389
But you should not write browser: autoprefixer.default
. Because, if you do it, you will disable browserslist
config.
I'm not. I'm offering it as the default value. If the user writes something it will use that instead.