Skip to content

Commit 8cd4ad9

Browse files
committed
Added option (noStyleTag) to omit the style tag when inlining css
1 parent e8db0a5 commit 8cd4ad9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/core/base-plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export class BasePlugin {
7575
htmlFileName: string
7676
style: string
7777
}) {
78-
const styleString = `<style type="text/css">${style}</style>`
78+
const styleString = this.config.noStyleTag
79+
? style
80+
: `<style type="text/css">${style}</style>`
7981
const replaceValues = [styleString, this.replaceConfig.target]
8082

8183
if (this.replaceConfig.position === 'after') {

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface Config {
1414
filter?(fileName: string): boolean
1515
leaveCSSFile?: boolean
1616
replace?: ReplaceConfig
17+
noStyleTag?: boolean
1718
}
1819

1920
export interface FileCache {

0 commit comments

Comments
 (0)