mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Fix it so css.TailwindCSS inlineImports options isn't always enabled
To avoid breaking existing setup and to make a better default option, the option is now `disableInlineImports` (default false). Fixes #13719
This commit is contained in:
@@ -129,9 +129,11 @@ func (t *tailwindcssTransformation) Transform(ctx *resources.ResourceTransformat
|
||||
t.rs.Assets.Fs, t.rs.Logger, ctx.DependencyManager,
|
||||
)
|
||||
|
||||
src, err = imp.resolve()
|
||||
if err != nil {
|
||||
return err
|
||||
if !options.InlineImports.DisableInlineImports {
|
||||
src, err = imp.resolve()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
go func() {
|
||||
@@ -146,7 +148,11 @@ func (t *tailwindcssTransformation) Transform(ctx *resources.ResourceTransformat
|
||||
Cause: err,
|
||||
}
|
||||
}
|
||||
return imp.toFileError(errBuf.String())
|
||||
s := errBuf.String()
|
||||
if options.InlineImports.DisableInlineImports && strings.Contains(s, "Can't resolve") {
|
||||
s += "You may want to set the 'disableInlineImports' option to false to inline imports, see https://gohugo.io/functions/css/tailwindcss/#disableinlineimports"
|
||||
}
|
||||
return imp.toFileError(s)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user