-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
47 lines (39 loc) · 1.24 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { resolve, join } from "path";
export default function Typo3Tailwind() {
const config = this.options.typo3tailwind || {
layouts: true
}
this.options.typo3.components = true
this.options.build.transpile.push('vee-validate/dist/rules')
if (config.layouts) {
this.addLayout(resolve(__dirname, "./layouts/default.vue"), "default");
}
this.addModule(["@nuxtjs/tailwindcss"]);
this.options.css.push(resolve(__dirname, 'style.css'))
this.nuxt.hook('components:dirs', dirs => {
dirs.push({
path: join(__dirname, 'components'),
extensions: ['vue'],
level: 100
})
})
this.nuxt.hook("tailwindcss:config", function (tailwindConfig) {
tailwindConfig.content = [
resolve(__dirname, "**/*.vue"),
'components/**/*.{vue,js,ts}',
'layouts/**/*.{vue,js,ts}',
'pages/**/*.{vue,js,ts}'
]
tailwindConfig.plugins.push(require('@tailwindcss/typography'));
tailwindConfig.theme = {extend: {
colors: {
primary: "#ff8700"
}
}};
});
this.extendBuild((config, { isDev, isClient }) => {
config.resolve.alias["~typo3-tailwind"] = resolve(__dirname);
});
}
// REQUIRED if publishing the module as npm package
module.exports.meta = require("./package.json");