@@ -76,6 +76,27 @@ export interface VuePluginOptions {
76
76
*/
77
77
customBlocks ?: string [ ] | ( ( tag : string ) => boolean )
78
78
79
+ /**
80
+ * Exclude customBlocks for final build.
81
+ * @default `['*']`
82
+ * @deprecated
83
+ * @example
84
+ * ```js
85
+ * VuePlugin({ blackListCustomBlocks: ['markdown', 'test'] })
86
+ * ```
87
+ */
88
+ blackListCustomBlocks ?: string [ ]
89
+ /**
90
+ * Include customBlocks for final build.
91
+ * @default `[]`
92
+ * @deprecated
93
+ * @example
94
+ * ```js
95
+ * VuePlugin({ blackListCustomBlocks: ['markdown', 'test'] })
96
+ * ```
97
+ */
98
+ whiteListCustomBlocks ?: string [ ]
99
+
79
100
/**
80
101
* Prepend CSS.
81
102
* @default `undefined`
@@ -164,8 +185,17 @@ export default function vue(opts: VuePluginOptions = {}): Plugin {
164
185
}
165
186
166
187
const shouldExtractCss = opts . css === false
188
+ const customBlocks : string [ ] = [ ]
167
189
168
- const isAllowed = createCustomBlockFilter ( opts . customBlocks )
190
+ if ( opts . blackListCustomBlocks ) {
191
+ console . warn ( '`blackListCustomBlocks` option is deprecated use `customBlocks`. See https://rollup-plugin-vue.vuejs.org/options.html#customblocks.' )
192
+ customBlocks . push ( ...opts . blackListCustomBlocks . map ( tag => '!' + tag ) )
193
+ }
194
+ if ( opts . whiteListCustomBlocks ) {
195
+ console . warn ( '`whiteListCustomBlocks` option is deprecated use `customBlocks`. See https://rollup-plugin-vue.vuejs.org/options.html#customblocks.' )
196
+ customBlocks . push ( ...opts . whiteListCustomBlocks )
197
+ }
198
+ const isAllowed = createCustomBlockFilter ( opts . customBlocks || customBlocks )
169
199
170
200
const beforeAssemble =
171
201
opts . beforeAssemble ||
@@ -181,6 +211,8 @@ export default function vue(opts: VuePluginOptions = {}): Plugin {
181
211
delete opts . css
182
212
delete opts . exposeFilename
183
213
delete opts . customBlocks
214
+ delete opts . blackListCustomBlocks
215
+ delete opts . whiteListCustomBlocks
184
216
delete opts . defaultLang
185
217
delete opts . include
186
218
delete opts . exclude
0 commit comments