Closed GHNewbiee closed 4 years ago
I have had a look at all plugins. Unfortunately, I cannot still figure out a standard way how to pass a plugin config object, e.g.
start({ // `Reboost` config object ... plugins: [ samplePlugin({ // `samplePlugin` config object pluginSpecificOptions }) ] });
into .../plugin-sample/src/index.ts samplePlugin function when Reboost starts.
.../plugin-sample/src/index.ts
samplePlugin
Reboost
config
setup
this.config
I have seen that, most of the times, an empty object is passed in options argument of the function:
options
export const CSSPlugin = (options: CSSPluginOptions = {}): ReboostPlugin => {, export = (options: Babel.TransformOptions = {}): ReboostPlugin => {..., export const esbuildPlugin = (options: esbuildPluginOptions = {}): ReboostPlugin => {..., export const PostCSSPlugin = (options: PostCSSPluginOptions = {}): ReboostPlugin => ({ export = (options: SveltePluginOptions = {}): ReboostPlugin => { or, even simpler export = (options: Options = {}): ReboostPlugin => {
export const CSSPlugin = (options: CSSPluginOptions = {}): ReboostPlugin => {
export = (options: Babel.TransformOptions = {}): ReboostPlugin => {...
export const esbuildPlugin = (options: esbuildPluginOptions = {}): ReboostPlugin => {...
export const PostCSSPlugin = (options: PostCSSPluginOptions = {}): ReboostPlugin => ({
export = (options: SveltePluginOptions = {}): ReboostPlugin => {
export = (options: Options = {}): ReboostPlugin => {
Please, enlighten me. Tia
Sorry, empty object is the default value when options is not defined, isn't it? So, options does always represent the plugin config object.
Yes, you're correct.
I have had a look at all plugins. Unfortunately, I cannot still figure out a standard way how to pass a plugin config object, e.g.
into
.../plugin-sample/src/index.ts
samplePlugin
function whenReboost
starts.config
argument ofsetup
function is the entireReboost
config objectthis.config
is the entireReboost
config object, too. In addition, it is not available insetup
function.I have seen that, most of the times, an empty object is passed in
options
argument of the function:export const CSSPlugin = (options: CSSPluginOptions = {}): ReboostPlugin => {
,export = (options: Babel.TransformOptions = {}): ReboostPlugin => {...
,export const esbuildPlugin = (options: esbuildPluginOptions = {}): ReboostPlugin => {...
,export const PostCSSPlugin = (options: PostCSSPluginOptions = {}): ReboostPlugin => ({
export = (options: SveltePluginOptions = {}): ReboostPlugin => {
or, even simplerexport = (options: Options = {}): ReboostPlugin => {
Please, enlighten me. Tia