Skip to content

Commit aa70b14

Browse files
committed
Init blud
0 parents  commit aa70b14

8 files changed

+580
-0
lines changed

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env", {
5+
"modules": false,
6+
}
7+
],
8+
]
9+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
package-lock.json

package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@silvanite/vuepress-plugin-tailwind",
3+
"version": "0.0.1",
4+
"description": "Tailwind CSS plugin for VuePress",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/silvanite/vuepress-plugin-tailwind.git"
8+
},
9+
"main": "dist/index.js",
10+
"files": [
11+
"dist",
12+
"readme.md"
13+
],
14+
"scripts": {
15+
"test": "echo \"Error: no test specified\" && exit 1",
16+
"build": "rollup -c",
17+
"watch": "rollup -mwc",
18+
"prepublish": "npm run build"
19+
},
20+
"keywords": [
21+
"vuepress",
22+
"plugin",
23+
"tailwind",
24+
"css"
25+
],
26+
"author": "Marco Mark <[email protected]>",
27+
"license": "MIT",
28+
"devDependencies": {
29+
"@babel/core": "^7.3.3",
30+
"@babel/preset-env": "7.3.1",
31+
"rollup": "^1.1.2",
32+
"rollup-plugin-babel": "^4.3.2",
33+
"tailwindcss": "^0.7.4"
34+
}
35+
}

readme.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# VuePress Plugin to add Tailwind CSS
2+
3+
## Installation
4+
5+
```sh
6+
npm i @silvanite/vuepress-plugin-tailwind
7+
```
8+
9+
Load the plugin inside your `config.js` or in your theme's `index.js`
10+
11+
```js
12+
module.exports = {
13+
...
14+
"plugins": [
15+
"@silvanite/tailwind"
16+
]
17+
}
18+
```
19+
20+
## Configuration options
21+
22+
You can overwrite the default configuration if required
23+
24+
```js
25+
module.exports = {
26+
...
27+
"plugins": [
28+
["@silvanite/tailwind", {
29+
config: "./tailwind.js"
30+
}]
31+
]
32+
}
33+
```
34+
35+
## Support
36+
37+
If you experience any problems with this VuePress Plugin please open a new issue or get in touch on Twitter [@m2de_io](https://twitter.com/m2de_io). Or just look me up anyway, I'd love to hear from you.

rollup.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import RollupPluginBabel from 'rollup-plugin-babel'
2+
3+
export default [
4+
{
5+
input: 'src/index.js',
6+
output: {
7+
file: 'dist/index.js',
8+
format: 'cjs',
9+
},
10+
external: [
11+
"path"
12+
],
13+
plugins: [
14+
RollupPluginBabel(),
15+
],
16+
},
17+
{
18+
input: 'src/tailwind.config.js',
19+
output: {
20+
file: 'dist/tailwind.config.js',
21+
format: 'cjs',
22+
},
23+
external: [],
24+
plugins: [
25+
RollupPluginBabel(),
26+
],
27+
}
28+
]

src/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import path from 'path'
2+
3+
const plugin = (options = {}, context) => {
4+
const { themeConfig, siteConfig } = context
5+
const { config } = options
6+
7+
siteConfig.postcss = Object.assign({
8+
plugins: [
9+
require("tailwindcss")(config || path.join(__dirname, "tailwind.config.js")),
10+
require("autoprefixer")
11+
]
12+
}, siteConfig.postcss)
13+
14+
return {
15+
name: '@silvanite/vuepress-plugin-tailwind',
16+
}
17+
}
18+
19+
export default plugin

0 commit comments

Comments
 (0)