@empjs/plugin-tailwindcss 1.2.8-beta.4 → 4.0.0-alpha.1

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/dist/index.d.ts CHANGED
@@ -1,28 +1,9 @@
1
- import { GlobalStore } from '@empjs/cli';
1
+ import type { GlobalStore } from '@empjs/cli';
2
2
  import autoprefixer from 'autoprefixer';
3
- import { Input, AcceptedPlugin } from 'postcss';
4
-
5
- /**
6
- * postcss-pxtorem 配置选项
7
- */
8
- interface PxToRemOptions {
9
- rootValue?: number | ((input: Input) => number);
10
- unitPrecision?: number;
11
- propList?: string[];
12
- selectorBlackList?: Array<string | RegExp>;
13
- replace?: boolean;
14
- mediaQuery?: boolean;
15
- minPixelValue?: number;
16
- exclude?: string | RegExp | ((file: string) => boolean);
17
- unit?: string;
18
- }
19
- type TailwindcssOptions = {
20
- pxToRemOptions?: PxToRemOptions;
21
- };
22
-
3
+ import type { AcceptedPlugin } from 'postcss';
4
+ import { TailwindcssOptions } from './types.js';
23
5
  declare const _default: (tailwindcssOptions?: TailwindcssOptions, autoprefixerOptions?: autoprefixer.Options, presetEnvFeature?: Record<string, boolean>, customPostcssPlugins?: AcceptedPlugin[]) => {
24
6
  name: string;
25
7
  rsConfig(store: GlobalStore): Promise<void>;
26
8
  };
27
-
28
- export { _default as default };
9
+ export default _default;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var r=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(l,n)=>(typeof require<"u"?require:l)[n]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});import m from"autoprefixer";import o from"path";var b=(s,l,n,p)=>({name:"@empjs/plugin-tailwindcss",async rsConfig(e){let{chain:a}=e,u=r.resolve("tailwindcss/package.json"),c=o.dirname(u),d=o.join(c,"index.css"),i=[r("postcss-import")({resolve:t=>t==="tailwindcss"?d:t.startsWith("tailwindcss/")?o.join(c,t.replace("tailwindcss/","")):t}),[r.resolve("@tailwindcss/postcss"),{sources:{include:["./src/**/*.{js,jsx,ts,tsx,html,css}"],exclude:["**/*.md"]}}]];e.empConfig.build.polyfill.browserslist&&e.empConfig.build.polyfill.browserslist.length>0&&i.push(["postcss-preset-env",{browsers:e.empConfig.build.polyfill.browserslist,stage:1,features:n}]),s?.pxToRemOptions&&i.push(["postcss-pxtorem",{rootValue:100,unitPrecision:3,propList:["*"],selectorBlackList:[],replace:!0,mediaQuery:!0,minPixelValue:0,...s.pxToRemOptions}]),i.push(m(l)),p&&p.length>0&&i.push(...p),a.module.rule(e.chainName.rule.css).include.add(o.join(process.cwd(),"src")).end().exclude.add(/\.md$/).end().set("type","css").use("postcss").loader(r.resolve("postcss-loader")).options({postcssOptions:{plugins:i}})}});export{b as default};
1
+ import s from"node:module";let e=s.createRequire(import.meta.url);import o from"autoprefixer";import i from"path";import{__webpack_require__ as t}from"./rslib-runtime.js";import*as r from"postcss-import";t.add({"postcss-import"(s){s.exports=r}});export default((s,r,p,l)=>({name:"@empjs/plugin-tailwindcss",async rsConfig(a){let{chain:n}=a,m=e.resolve("tailwindcss/package.json"),c=i.dirname(m),u=i.join(c,"index.css"),d=[t("postcss-import")({resolve:s=>"tailwindcss"===s?u:s.startsWith("tailwindcss/")?i.join(c,s.replace("tailwindcss/","")):s}),[e.resolve("@tailwindcss/postcss"),{}]];a.empConfig.build.polyfill.browserslist&&a.empConfig.build.polyfill.browserslist.length>0&&d.push(["postcss-preset-env",{browsers:a.empConfig.build.polyfill.browserslist,stage:1,features:p}]),s?.pxToRemOptions&&d.push(["postcss-pxtorem",{rootValue:100,unitPrecision:3,propList:["*"],selectorBlackList:[],replace:!0,mediaQuery:!0,minPixelValue:0,...s.pxToRemOptions}]),d.push(o(r)),l&&l.length>0&&d.push(...l),n.module.rule(a.chainName.rule.css).set("type","css").use("postcss").loader(e.resolve("postcss-loader")).options({postcssOptions:{plugins:d}})}}));
@@ -0,0 +1 @@
1
+ import"node:module";var r={},e={};function o(t){var n=e[t];if(void 0!==n)return n.exports;var i=e[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.m=r,o.add=function(r){Object.assign(o.m,r)};export{o as __webpack_require__};
@@ -1,2 +1,3 @@
1
1
  export * from 'tailwindcss';
2
- export { default as plugin } from 'tailwindcss/plugin';
2
+ import plugin from 'tailwindcss/plugin';
3
+ export { plugin };
@@ -1 +1 @@
1
- export*from"tailwindcss";import m from"tailwindcss/plugin";export{m as plugin};
1
+ import"node:module";export*from"tailwindcss";export{default as plugin}from"tailwindcss/plugin";
@@ -0,0 +1,18 @@
1
+ import type { Input } from 'postcss';
2
+ /**
3
+ * postcss-pxtorem 配置选项
4
+ */
5
+ export interface PxToRemOptions {
6
+ rootValue?: number | ((input: Input) => number);
7
+ unitPrecision?: number;
8
+ propList?: string[];
9
+ selectorBlackList?: Array<string | RegExp>;
10
+ replace?: boolean;
11
+ mediaQuery?: boolean;
12
+ minPixelValue?: number;
13
+ exclude?: string | RegExp | ((file: string) => boolean);
14
+ unit?: string;
15
+ }
16
+ export type TailwindcssOptions = {
17
+ pxToRemOptions?: PxToRemOptions;
18
+ };
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "name": "@empjs/plugin-tailwindcss",
3
- "version": "1.2.8-beta.4",
3
+ "version": "4.0.0-alpha.1",
4
4
  "description": "base tailwind 4",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "files": ["dist"],
8
- "maintainers": ["xuhongbin", "ckken"],
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "maintainers": [
11
+ "xuhongbin",
12
+ "ckken"
13
+ ],
9
14
  "repository": {
10
15
  "type": "git",
11
16
  "url": "git+https://github.com/empjs/emp.git",
@@ -14,41 +19,30 @@
14
19
  "publishConfig": {
15
20
  "access": "public"
16
21
  },
17
- "keywords": ["vue", "vue2"],
18
- "main": "dist/index.js",
19
- "types": "dist/index.d.ts",
22
+ "keywords": [
23
+ "vue",
24
+ "vue2"
25
+ ],
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
20
28
  "exports": {
21
29
  ".": {
22
- "import": {
23
- "types": "./dist/index.d.ts",
24
- "default": "./dist/index.js"
25
- },
26
- "require": {
27
- "types": "./dist/index.d.cts",
28
- "default": "./dist/index.cjs"
29
- }
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "default": "./dist/index.js"
30
33
  },
31
34
  "./tailwindcss": {
32
- "import": {
33
- "types": "./dist/tailwindcss.d.ts",
34
- "default": "./dist/tailwindcss.js"
35
- },
36
- "require": {
37
- "types": "./dist/tailwindcss.d.cts",
38
- "default": "./dist/tailwindcss.cjs"
39
- }
35
+ "types": "./dist/tailwindcss.d.ts",
36
+ "import": "./dist/tailwindcss.js",
37
+ "default": "./dist/tailwindcss.js"
40
38
  }
41
39
  },
42
- "scripts": {
43
- "build": "tsup",
44
- "dev": "tsup --watch"
45
- },
46
40
  "engines": {
47
- "node": ">=16.0.0"
41
+ "node": "^20.19.0 || >=22.12.0"
48
42
  },
49
43
  "author": "Ken",
50
44
  "devDependencies": {
51
- "@empjs/cli": "workspace:*"
45
+ "@empjs/cli": "4.0.0-alpha.1"
52
46
  },
53
47
  "dependencies": {
54
48
  "autoprefixer": "10.4.22",
@@ -59,5 +53,9 @@
59
53
  "tailwindcss": "4.1.17",
60
54
  "postcss-import": "^16.1.1",
61
55
  "postcss-pxtorem": "^6.1.0"
56
+ },
57
+ "scripts": {
58
+ "build": "rslib build --env-mode production",
59
+ "dev": "rslib build --watch --env-mode development"
62
60
  }
63
- }
61
+ }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";var h=Object.create;var c=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var j=(e,s)=>{for(var r in s)c(e,r,{get:s[r],enumerable:!0})},a=(e,s,r,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of x(s))!y.call(e,i)&&i!==r&&c(e,i,{get:()=>s[i],enumerable:!(t=w(s,i))||t.enumerable});return e};var l=(e,s,r)=>(r=e!=null?h(b(e)):{},a(s||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),v=e=>a(c({},"__esModule",{value:!0}),e);var q={};j(q,{default:()=>O});module.exports=v(q);var d=l(require("autoprefixer"),1),n=l(require("path"),1),O=(e,s,r,t)=>({name:"@empjs/plugin-tailwindcss",async rsConfig(i){let{chain:m}=i,f=require.resolve("tailwindcss/package.json"),u=n.default.dirname(f),g=n.default.join(u,"index.css"),o=[require("postcss-import")({resolve:p=>p==="tailwindcss"?g:p.startsWith("tailwindcss/")?n.default.join(u,p.replace("tailwindcss/","")):p}),[require.resolve("@tailwindcss/postcss"),{sources:{include:["./src/**/*.{js,jsx,ts,tsx,html,css}"],exclude:["**/*.md"]}}]];i.empConfig.build.polyfill.browserslist&&i.empConfig.build.polyfill.browserslist.length>0&&o.push(["postcss-preset-env",{browsers:i.empConfig.build.polyfill.browserslist,stage:1,features:r}]),e?.pxToRemOptions&&o.push(["postcss-pxtorem",{rootValue:100,unitPrecision:3,propList:["*"],selectorBlackList:[],replace:!0,mediaQuery:!0,minPixelValue:0,...e.pxToRemOptions}]),o.push((0,d.default)(s)),t&&t.length>0&&o.push(...t),m.module.rule(i.chainName.rule.css).include.add(n.default.join(process.cwd(),"src")).end().exclude.add(/\.md$/).end().set("type","css").use("postcss").loader(require.resolve("postcss-loader")).options({postcssOptions:{plugins:o}})}});
package/dist/index.d.cts DELETED
@@ -1,28 +0,0 @@
1
- import { GlobalStore } from '@empjs/cli';
2
- import autoprefixer from 'autoprefixer';
3
- import { Input, AcceptedPlugin } from 'postcss';
4
-
5
- /**
6
- * postcss-pxtorem 配置选项
7
- */
8
- interface PxToRemOptions {
9
- rootValue?: number | ((input: Input) => number);
10
- unitPrecision?: number;
11
- propList?: string[];
12
- selectorBlackList?: Array<string | RegExp>;
13
- replace?: boolean;
14
- mediaQuery?: boolean;
15
- minPixelValue?: number;
16
- exclude?: string | RegExp | ((file: string) => boolean);
17
- unit?: string;
18
- }
19
- type TailwindcssOptions = {
20
- pxToRemOptions?: PxToRemOptions;
21
- };
22
-
23
- declare const _default: (tailwindcssOptions?: TailwindcssOptions, autoprefixerOptions?: autoprefixer.Options, presetEnvFeature?: Record<string, boolean>, customPostcssPlugins?: AcceptedPlugin[]) => {
24
- name: string;
25
- rsConfig(store: GlobalStore): Promise<void>;
26
- };
27
-
28
- export { _default as default };
@@ -1 +0,0 @@
1
- "use strict";var l=Object.create;var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var c=(o,r)=>{for(var p in r)i(o,p,{get:r[p],enumerable:!0})},f=(o,r,p,x)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!b.call(o,t)&&t!==p&&i(o,t,{get:()=>r[t],enumerable:!(x=n(r,t))||x.enumerable});return o},e=(o,r,p)=>(f(o,r,"default"),p&&f(p,r,"default")),d=(o,r,p)=>(p=o!=null?l(a(o)):{},f(r||!o||!o.__esModule?i(p,"default",{value:o,enumerable:!0}):p,o)),h=o=>f(i({},"__esModule",{value:!0}),o);var m={};c(m,{plugin:()=>g.default});module.exports=h(m);e(m,require("tailwindcss"),module.exports);var g=d(require("tailwindcss/plugin"),1);0&&(module.exports={plugin,...require("tailwindcss")});
@@ -1,2 +0,0 @@
1
- export * from 'tailwindcss';
2
- export { default as plugin } from 'tailwindcss/plugin';