We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 094bb95 commit 1af0114Copy full SHA for 1af0114
src/core/unplugin.ts
@@ -8,7 +8,6 @@ import { ifDirective, includeDirective, MessageDirective, theDefineDirective } f
8
export const unpluginFactory: UnpluginFactory<UserOptions | undefined> = (
9
options,
10
) => {
11
- // @ts-expect-error ignore
12
const ctx = new Context({ ...options, directives: [ifDirective, theDefineDirective, includeDirective, MessageDirective, ...options?.directives ?? []] })
13
return {
14
name: 'unplugin-preprocessor-directives',
src/types.ts
@@ -4,7 +4,7 @@ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null
4
5
export interface Options {
6
cwd: string
7
- directives: Directive[]
+ directives: Directive<any, any>[]
include: FilterPattern
exclude: FilterPattern
}
test/define.test.ts
@@ -6,7 +6,6 @@ import { Context, theDefineDirective } from '../src'
describe('define', () => {
const root = resolve(__dirname, './fixtures')
const context = new Context({
directives: [theDefineDirective],
})
test/if.test.ts
@@ -7,7 +7,6 @@ import { Context, ifDirective } from '../src'
describe('if', () => {
directives: [ifDirective],
test/include.test.ts
@@ -7,7 +7,6 @@ describe('include', () => {
cwd: root,
directives: [includeDirective, ifDirective, theDefineDirective],
test/message.test.ts
@@ -4,7 +4,6 @@ import { Context, ifDirective, MessageDirective } from '../src'
describe('message', () => {
it('should log error message', () => {
directives: [MessageDirective],
@@ -18,7 +17,6 @@ describe('message', () => {
18
17
19
it('should log warning message', () => {
20
21
22
23
24
@@ -32,7 +30,6 @@ describe('message', () => {
32
30
33
31
it('should log info message', () => {
34
35
36
37
38
@@ -46,7 +43,6 @@ describe('message', () => {
46
43
47
44
it('with if directive', () => {
48
45
49
50
directives: [ifDirective, MessageDirective],
51
52
context.env.DEV = true
test/sourcemap.test.ts
@@ -3,7 +3,6 @@ import { Context, ifDirective } from '../src'
3
describe('sourcemap', () => {
0 commit comments