@empjs/plugin-tailwindcss2 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @empjs/plugin-tailwindcss3
|
|
2
|
+
## 安装
|
|
3
|
+
```
|
|
4
|
+
pnpm add @empjs/plugin-tailwindcss3 -D
|
|
5
|
+
```
|
|
6
|
+
## 使用
|
|
7
|
+
```js
|
|
8
|
+
import pluginTailwindcss from '@empjs/plugin-tailwindcss3'
|
|
9
|
+
import {defineConfig} from '@empjs/cli'
|
|
10
|
+
export default defineConfig(({mode, env}) => {
|
|
11
|
+
return {
|
|
12
|
+
plugins: [pluginTailwindcss()],
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 配置参数
|
|
19
|
+
插件支持传入 Tailwind CSS v3 的配置选项,例如:
|
|
20
|
+
```js
|
|
21
|
+
import pluginTailwindcss from '@empjs/plugin-tailwindcss3'
|
|
22
|
+
import {defineConfig} from '@empjs/cli'
|
|
23
|
+
|
|
24
|
+
export default defineConfig(({mode, env}) => {
|
|
25
|
+
return {
|
|
26
|
+
plugins: [
|
|
27
|
+
pluginTailwindcss({
|
|
28
|
+
// 指定要扫描的文件
|
|
29
|
+
content: [`${appSrc}/src/**/*.{js,jsx,ts,tsx}`],
|
|
30
|
+
// 自定义主题
|
|
31
|
+
theme: {
|
|
32
|
+
extend: {
|
|
33
|
+
colors: {
|
|
34
|
+
primary: '#3490dc',
|
|
35
|
+
secondary: '#ffed4a',
|
|
36
|
+
danger: '#e3342f',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
// 添加插件
|
|
41
|
+
plugins: [
|
|
42
|
+
require('@tailwindcss/forms'),
|
|
43
|
+
require('@tailwindcss/typography'),
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
### 默认配置
|
|
51
|
+
如果不传入配置参数,插件会使用以下默认配置:
|
|
52
|
+
```js
|
|
53
|
+
{
|
|
54
|
+
content: [`${appSrc}/**/*.{html,js,ts,jsx,tsx}`],
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
其中 appSrc 是项目源代码目录路径。
|
|
58
|
+
|
|
59
|
+
更多 Tailwind CSS v3 配置选项,请参考 [Tailwind CSS 官方文档](https://v3.tailwindcss.com/) 。
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var c=Object.create;var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var g=(e,i)=>{for(var s in i)p(e,s,{get:i[s],enumerable:!0})},a=(e,i,s,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of m(i))!f.call(e,t)&&t!==s&&p(e,t,{get:()=>i[t],enumerable:!(o=u(i,t))||o.enumerable});return e};var r=(e,i,s)=>(s=e!=null?c(d(e)):{},a(i||!e||!e.__esModule?p(s,"default",{value:e,enumerable:!0}):s,e)),x=e=>a(p({},"__esModule",{value:!0}),e);var y={};g(y,{default:()=>w});module.exports=x(y);var n=r(require("autoprefixer"),1),l=r(require("tailwindcss"),1),w=(e,i)=>({name:"@empjs/plugin-tailwindcss2",async rsConfig(s){let{chain:o}=s,t={purge:[`${s.appSrc}/**/*.{html,js,ts,jsx,tsx}`],darkMode:!1,theme:{extend:{}},variants:{extend:{}},plugins:[]};e=s.deepAssign(t,e),o.module.rule(s.chainName.rule.css).set("type","css").use("postcss").loader(require.resolve("postcss-loader")).options({postcssOptions:{plugins:[(0,l.default)(e),(0,n.default)(i)]},sourceMap:s.isDev})}});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GlobalStore } from '@empjs/cli';
|
|
2
|
+
import autoprefixer from 'autoprefixer';
|
|
3
|
+
import tailwindcss from 'tailwindcss';
|
|
4
|
+
|
|
5
|
+
type TailwindConfig = Parameters<typeof tailwindcss>[0];
|
|
6
|
+
declare const _default: (tailwindConfig?: TailwindConfig, options?: autoprefixer.Options) => {
|
|
7
|
+
name: string;
|
|
8
|
+
rsConfig(store: GlobalStore): Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { type TailwindConfig, _default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GlobalStore } from '@empjs/cli';
|
|
2
|
+
import autoprefixer from 'autoprefixer';
|
|
3
|
+
import tailwindcss from 'tailwindcss';
|
|
4
|
+
|
|
5
|
+
type TailwindConfig = Parameters<typeof tailwindcss>[0];
|
|
6
|
+
declare const _default: (tailwindConfig?: TailwindConfig, options?: autoprefixer.Options) => {
|
|
7
|
+
name: string;
|
|
8
|
+
rsConfig(store: GlobalStore): Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { type TailwindConfig, _default as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(i,s)=>(typeof require<"u"?require:i)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});import r from"autoprefixer";import a from"tailwindcss";var m=(e,i)=>({name:"@empjs/plugin-tailwindcss2",async rsConfig(s){let{chain:o}=s,p={purge:[`${s.appSrc}/**/*.{html,js,ts,jsx,tsx}`],darkMode:!1,theme:{extend:{}},variants:{extend:{}},plugins:[]};e=s.deepAssign(p,e),o.module.rule(s.chainName.rule.css).set("type","css").use("postcss").loader(t.resolve("postcss-loader")).options({postcssOptions:{plugins:[a(e),r(i)]},sourceMap:s.isDev})}});export{m as default};
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@empjs/plugin-tailwindcss2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "base tailwind 2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"maintainers": [
|
|
11
|
+
"xuhongbin",
|
|
12
|
+
"ckken"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/empjs/emp.git",
|
|
17
|
+
"directory": "packages/plugin-tailwindcss2"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"vue",
|
|
24
|
+
"vue2"
|
|
25
|
+
],
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"types": "dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/index.d.cts",
|
|
36
|
+
"default": "./dist/index.cjs"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=16.0.0"
|
|
42
|
+
},
|
|
43
|
+
"author": "Ken",
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^22.13.11",
|
|
46
|
+
"@types/tailwindcss": "^2.2.4",
|
|
47
|
+
"tsup": "^8.1.0",
|
|
48
|
+
"@empjs/cli": "3.8.3"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"autoprefixer": "^10.4.21",
|
|
52
|
+
"postcss": "^8.5.3",
|
|
53
|
+
"postcss-loader": "^8.1.1",
|
|
54
|
+
"tailwindcss": "2.2.19"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsup --watch"
|
|
59
|
+
}
|
|
60
|
+
}
|