Skip to content

Commit 8a9a079

Browse files
committed
Refine plugin options
1 parent 4c5ad22 commit 8a9a079

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import { getLocalIdent, isFileIncluded, hasModuleImports, hasModuleAttribute } f
66

77
let pluginOptions: PluginOptions = {
88
mode: 'native',
9-
includePaths: [],
10-
localIdentName: '[local]-[hash:base64:6]',
119
getLocalIdent,
1210
hashSeeder: ['style', 'filepath', 'classname'],
13-
allowedAttributes: [],
11+
includePaths: [],
12+
includeAttributes: [],
13+
localIdentName: '[local]-[hash:base64:6]',
14+
parseStyleTag: true,
15+
parseExternalStylesheet: false,
16+
useAsDefaultScoping: false,
1417
};
1518

1619
const markup = async ({ content, filename }: PreprocessorOptions): Promise<PreprocessorResult> => {

src/parsers/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const parseExpression = (processor: Processor, expression: TemplateNode): void =
4242
*/
4343
export default (processor: Processor): void => {
4444
const directiveLength: number = 'class:'.length;
45-
const allowedAttributes = ['class', ...processor.options.allowedAttributes];
45+
const allowedAttributes = ['class', ...processor.options.includeAttributes];
4646

4747
walk(processor.ast.html, {
4848
enter(baseNode) {

src/types/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import { GetLocalIdent } from '../lib';
1+
import type { GetLocalIdent } from '../lib';
22

33
export type PluginOptions = {
44
mode: 'native' | 'mixed' | 'scoped';
5+
includeAttributes: string[];
56
includePaths: string[];
67
localIdentName: string;
78
getLocalIdent: GetLocalIdent;
89
hashSeeder: Array<'style' | 'filepath' | 'classname'>;
9-
allowedAttributes: string[];
10+
parseStyleTag: boolean;
11+
parseExternalStylesheet: boolean;
12+
useAsDefaultScoping: boolean;
1013
};
1114

1215
export interface PreprocessorOptions {

0 commit comments

Comments
 (0)