Skip to content

Commit

Permalink
Merge pull request #6 from vortesnail/master
Browse files Browse the repository at this point in the history
feat: support customLinkHref when load default them link file like use absolute path.
  • Loading branch information
GitOfZGT authored Mar 11, 2022
2 parents 70ae574 + baa2b0b commit b91bf24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apply/presetModeApply.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function getThemeExtractLinkTag({ publicPath, userOptions }) {
tagName: 'link',
voidTag: true,
attributes: {
href: `/${publicPath || ''}/${
href: userOptions.customLinkHref(`/${publicPath || ''}/${
userOptions.outputDir || ''
}/${filename}.css`.replace(/\/+(?=\/)/g, ''),
}/${filename}.css`.replace(/\/+(?=\/)/g, '')),
rel: 'stylesheet',
id: userOptions.themeLinkTagId,
},
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ThemeCssExtractWebpackPlugin {
includeStyleWithColors: [],
hueDiffControls: { low: 0, high: 0 },
customThemeOutputPath: '',
customLinkHref: (href) => href
},
options
);
Expand Down
4 changes: 4 additions & 0 deletions src/plugin-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
"customThemeOutputPath": {
"description": "(https://github.com/GitOfZGT/theme-css-extract-webpack-plugin#customThemeOutputPath).",
"type": "string"
},
"customLinkHref": {
"description": "(https://github.com/GitOfZGT/theme-css-extract-webpack-plugin#customLinkHref).",
"instanceof": "Function"
}
}
}

0 comments on commit b91bf24

Please sign in to comment.