File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const logger = require('./logger')
7
7
const defaultTailwindConfig = require ( './files/tailwind.config.js' )
8
8
9
9
module . exports = async function ( moduleOptions ) {
10
- const { nuxt, addTemplate } = this
10
+ const { nuxt } = this
11
11
const options = defu . arrayFn ( moduleOptions , nuxt . options . tailwindcss , {
12
12
configPath : 'tailwind.config.js' ,
13
13
cssPath : join ( nuxt . options . dir . assets , 'css' , 'tailwind.css' ) ,
@@ -99,7 +99,11 @@ module.exports = async function (moduleOptions) {
99
99
const resolvedConfig = resolveConfig ( tailwindConfig )
100
100
101
101
// Render as a json file in buildDir
102
- addTemplate ( {
102
+ /**
103
+ * nuxt ModuleContainer bind 'this' to addTemplate until v2.13.0,use this.addTemplate to compat with low version
104
+ * issue: https://github.com/nuxt-community/tailwindcss-module/issues/224
105
+ */
106
+ this . addTemplate ( {
103
107
src : resolve ( __dirname , 'templates/tailwind.config.json' ) ,
104
108
fileName : 'tailwind.config.json' ,
105
109
options : { config : resolvedConfig }
You can’t perform that action at this time.
0 commit comments