Plugin method install() runs before setOptions()
See original GitHub issueThis breaks plugins like less-plugin-autoprefix in Less v3.x.
Test Plugin
less-plugin-test/index.js in global node_modules:
module.exports = {
install: function (less, pluginManager) {
console.group('running install()')
console.log('this.options:', this.options)
console.groupEnd()
},
setOptions: function(options) {
console.group('running setOptions()')
this.options = options
console.log('this.options:', this.options)
console.groupEnd()
},
}
Less 2.x
npm i -g less@2 && lessc --test="test" empty.less
Result:
running setOptions()
this.options: test
running install()
this.options: test
Less 3.x (including 3.5.0-beta)
npm i -g less@3.5.0-beta && lessc --test="test" empty.less
Result:
running install()
this.options: undefined
running setOptions()
this.options: test
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Preferences Capacitor Plugin API
The Preferences API provides a simple key/value persistent store for lightweight data.
Read more >update_option() | Function - WordPress Developer Resources
This function is designed to work with or without a logged-in user. In terms of security, plugin developers should check the current user's...
Read more >Guide to Developing Java Plugins - Apache Maven
Your First Plugin. In this section we will build a simple plugin with one goal which takes no parameters and simply displays a...
Read more >MediaCodec - Android Developers
Call stop() to return the codec to the Uninitialized state, whereupon it may ... Running. End of Stream. Error. Released. SDK Version. State,...
Read more >Command Line Usage - Less CSS
Pre-loading plugins is necessary if you want to add a Less.js Pre-processor. That is, a plugin that gets called and passed the raw...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I merged, so I’ll close this.
Yup, this fixes less-plugin-autoprefix. I’m gonna quick look into maybe only doing the double-run for plugins with minimum version < 3, but I don’t think this should wait for that, since it’s possibly getting in the way of people’s workflows.