motionwind-unplugin 2.1.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 ADDED
@@ -0,0 +1,24 @@
1
+ # motionwind-unplugin v2
2
+
3
+ Shared React/JSX compiler integration for Vite, Rollup, webpack, Rspack, and
4
+ esbuild.
5
+
6
+ ```bash
7
+ npm install -D motionwind-unplugin@2
8
+ npm install motionwind-react@2 motion motionwind-core@2
9
+ ```
10
+
11
+ ```ts
12
+ import motionwind from "motionwind-unplugin/vite";
13
+
14
+ export default {
15
+ plugins: [motionwind({ config: motionwindConfig })],
16
+ };
17
+ ```
18
+
19
+ Equivalent entry points are available at `/rollup`, `/webpack`, `/rspack`, and
20
+ `/esbuild`. The transform runs before JSX compilation, preserves source maps,
21
+ and accepts `{ config, include }`. Babel and the focused React Vite/Next entry
22
+ points remain supported.
23
+
24
+ MIT
@@ -0,0 +1,43 @@
1
+ // src/index.ts
2
+ import { transformSync } from "@babel/core";
3
+ import { createUnplugin } from "unplugin";
4
+ import motionwindBabelPlugin from "motionwind-react/babel";
5
+ var motionwindUnplugin = createUnplugin((options = {}) => ({
6
+ name: "motionwind",
7
+ enforce: "pre",
8
+ transformInclude(id) {
9
+ return (options.include ?? /\.[jt]sx$/).test(id);
10
+ },
11
+ transform(code, id) {
12
+ if (!code.includes("animate-")) return null;
13
+ const result = transformSync(code, {
14
+ plugins: [
15
+ [motionwindBabelPlugin, options.config ?? {}],
16
+ "@babel/plugin-syntax-jsx"
17
+ ],
18
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
19
+ filename: id,
20
+ configFile: false,
21
+ babelrc: false,
22
+ sourceMaps: true
23
+ });
24
+ return result?.code ? { code: result.code, map: result.map } : null;
25
+ }
26
+ }));
27
+ var vite = motionwindUnplugin.vite;
28
+ var rollup = motionwindUnplugin.rollup;
29
+ var webpack = motionwindUnplugin.webpack;
30
+ var rspack = motionwindUnplugin.rspack;
31
+ var esbuild = motionwindUnplugin.esbuild;
32
+ var src_default = motionwindUnplugin;
33
+
34
+ export {
35
+ motionwindUnplugin,
36
+ vite,
37
+ rollup,
38
+ webpack,
39
+ rspack,
40
+ esbuild,
41
+ src_default
42
+ };
43
+ //# sourceMappingURL=chunk-IIE2P3AO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,OAAO,2BAA2B;AAQ3B,IAAM,qBAAqB,eAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,SAAS,cAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,uBAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AAE1C,IAAO,cAAQ;","names":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/esbuild.ts
31
+ var esbuild_exports = {};
32
+ __export(esbuild_exports, {
33
+ default: () => esbuild,
34
+ esbuild: () => esbuild
35
+ });
36
+ module.exports = __toCommonJS(esbuild_exports);
37
+
38
+ // src/index.ts
39
+ var import_core = require("@babel/core");
40
+ var import_unplugin = require("unplugin");
41
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
42
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
43
+ name: "motionwind",
44
+ enforce: "pre",
45
+ transformInclude(id) {
46
+ return (options.include ?? /\.[jt]sx$/).test(id);
47
+ },
48
+ transform(code, id) {
49
+ if (!code.includes("animate-")) return null;
50
+ const result = (0, import_core.transformSync)(code, {
51
+ plugins: [
52
+ [import_babel.default, options.config ?? {}],
53
+ "@babel/plugin-syntax-jsx"
54
+ ],
55
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
56
+ filename: id,
57
+ configFile: false,
58
+ babelrc: false,
59
+ sourceMaps: true
60
+ });
61
+ return result?.code ? { code: result.code, map: result.map } : null;
62
+ }
63
+ }));
64
+ var vite = motionwindUnplugin.vite;
65
+ var rollup = motionwindUnplugin.rollup;
66
+ var webpack = motionwindUnplugin.webpack;
67
+ var rspack = motionwindUnplugin.rspack;
68
+ var esbuild = motionwindUnplugin.esbuild;
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ esbuild
72
+ });
73
+ //# sourceMappingURL=esbuild.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/esbuild.ts","../src/index.ts"],"sourcesContent":["export { esbuild as default, esbuild } from \"./index.js\";\n","import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,10 @@
1
+ import _default from './index.cjs';
2
+ // @ts-ignore
3
+ export = _default;
4
+ export { esbuild } from './index.cjs';
5
+ import 'esbuild';
6
+ import 'webpack';
7
+ import 'rollup';
8
+ import 'vite';
9
+ import 'unplugin';
10
+ import 'motionwind-core';
@@ -0,0 +1,7 @@
1
+ export { esbuild as default, esbuild } from './index.js';
2
+ import 'esbuild';
3
+ import 'webpack';
4
+ import 'rollup';
5
+ import 'vite';
6
+ import 'unplugin';
7
+ import 'motionwind-core';
@@ -0,0 +1,8 @@
1
+ import {
2
+ esbuild
3
+ } from "./chunk-IIE2P3AO.js";
4
+ export {
5
+ esbuild as default,
6
+ esbuild
7
+ };
8
+ //# sourceMappingURL=esbuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ default: () => src_default,
34
+ esbuild: () => esbuild,
35
+ motionwindUnplugin: () => motionwindUnplugin,
36
+ rollup: () => rollup,
37
+ rspack: () => rspack,
38
+ vite: () => vite,
39
+ webpack: () => webpack
40
+ });
41
+ module.exports = __toCommonJS(src_exports);
42
+ var import_core = require("@babel/core");
43
+ var import_unplugin = require("unplugin");
44
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
45
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
46
+ name: "motionwind",
47
+ enforce: "pre",
48
+ transformInclude(id) {
49
+ return (options.include ?? /\.[jt]sx$/).test(id);
50
+ },
51
+ transform(code, id) {
52
+ if (!code.includes("animate-")) return null;
53
+ const result = (0, import_core.transformSync)(code, {
54
+ plugins: [
55
+ [import_babel.default, options.config ?? {}],
56
+ "@babel/plugin-syntax-jsx"
57
+ ],
58
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
59
+ filename: id,
60
+ configFile: false,
61
+ babelrc: false,
62
+ sourceMaps: true
63
+ });
64
+ return result?.code ? { code: result.code, map: result.map } : null;
65
+ }
66
+ }));
67
+ var vite = motionwindUnplugin.vite;
68
+ var rollup = motionwindUnplugin.rollup;
69
+ var webpack = motionwindUnplugin.webpack;
70
+ var rspack = motionwindUnplugin.rspack;
71
+ var esbuild = motionwindUnplugin.esbuild;
72
+ var src_default = motionwindUnplugin;
73
+ // Annotate the CommonJS export names for ESM import in node:
74
+ 0 && (module.exports = {
75
+ esbuild,
76
+ motionwindUnplugin,
77
+ rollup,
78
+ rspack,
79
+ vite,
80
+ webpack
81
+ });
82
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AAE1C,IAAO,cAAQ;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,21 @@
1
+ import * as _esbuild from 'esbuild';
2
+ import * as _webpack from 'webpack';
3
+ import * as _rollup from 'rollup';
4
+ import * as _vite from 'vite';
5
+ import * as unplugin from 'unplugin';
6
+ import { MotionwindConfig } from 'motionwind-core';
7
+
8
+ interface MotionwindUnpluginOptions {
9
+ config?: MotionwindConfig;
10
+ include?: RegExp;
11
+ }
12
+ declare const motionwindUnplugin: unplugin.UnpluginInstance<MotionwindUnpluginOptions | undefined, boolean>;
13
+ declare const vite: (options?: MotionwindUnpluginOptions | undefined) => _vite.Plugin<any> | _vite.Plugin<any>[];
14
+ declare const rollup: (options?: MotionwindUnpluginOptions | undefined) => _rollup.Plugin<any> | _rollup.Plugin<any>[];
15
+ declare const webpack: (options?: MotionwindUnpluginOptions | undefined) => _webpack.WebpackPluginInstance;
16
+ declare const rspack: (options?: MotionwindUnpluginOptions | undefined) => RspackPluginInstance;
17
+ declare const esbuild: (options?: MotionwindUnpluginOptions | undefined) => _esbuild.Plugin;
18
+
19
+ // @ts-ignore
20
+ export = motionwindUnplugin;
21
+ export { type MotionwindUnpluginOptions, esbuild, motionwindUnplugin, rollup, rspack, vite, webpack };
@@ -0,0 +1,19 @@
1
+ import * as _esbuild from 'esbuild';
2
+ import * as _webpack from 'webpack';
3
+ import * as _rollup from 'rollup';
4
+ import * as _vite from 'vite';
5
+ import * as unplugin from 'unplugin';
6
+ import { MotionwindConfig } from 'motionwind-core';
7
+
8
+ interface MotionwindUnpluginOptions {
9
+ config?: MotionwindConfig;
10
+ include?: RegExp;
11
+ }
12
+ declare const motionwindUnplugin: unplugin.UnpluginInstance<MotionwindUnpluginOptions | undefined, boolean>;
13
+ declare const vite: (options?: MotionwindUnpluginOptions | undefined) => _vite.Plugin<any> | _vite.Plugin<any>[];
14
+ declare const rollup: (options?: MotionwindUnpluginOptions | undefined) => _rollup.Plugin<any> | _rollup.Plugin<any>[];
15
+ declare const webpack: (options?: MotionwindUnpluginOptions | undefined) => _webpack.WebpackPluginInstance;
16
+ declare const rspack: (options?: MotionwindUnpluginOptions | undefined) => RspackPluginInstance;
17
+ declare const esbuild: (options?: MotionwindUnpluginOptions | undefined) => _esbuild.Plugin;
18
+
19
+ export { type MotionwindUnpluginOptions, motionwindUnplugin as default, esbuild, motionwindUnplugin, rollup, rspack, vite, webpack };
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ import {
2
+ esbuild,
3
+ motionwindUnplugin,
4
+ rollup,
5
+ rspack,
6
+ src_default,
7
+ vite,
8
+ webpack
9
+ } from "./chunk-IIE2P3AO.js";
10
+ export {
11
+ src_default as default,
12
+ esbuild,
13
+ motionwindUnplugin,
14
+ rollup,
15
+ rspack,
16
+ vite,
17
+ webpack
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/rollup.ts
31
+ var rollup_exports = {};
32
+ __export(rollup_exports, {
33
+ default: () => rollup,
34
+ rollup: () => rollup
35
+ });
36
+ module.exports = __toCommonJS(rollup_exports);
37
+
38
+ // src/index.ts
39
+ var import_core = require("@babel/core");
40
+ var import_unplugin = require("unplugin");
41
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
42
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
43
+ name: "motionwind",
44
+ enforce: "pre",
45
+ transformInclude(id) {
46
+ return (options.include ?? /\.[jt]sx$/).test(id);
47
+ },
48
+ transform(code, id) {
49
+ if (!code.includes("animate-")) return null;
50
+ const result = (0, import_core.transformSync)(code, {
51
+ plugins: [
52
+ [import_babel.default, options.config ?? {}],
53
+ "@babel/plugin-syntax-jsx"
54
+ ],
55
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
56
+ filename: id,
57
+ configFile: false,
58
+ babelrc: false,
59
+ sourceMaps: true
60
+ });
61
+ return result?.code ? { code: result.code, map: result.map } : null;
62
+ }
63
+ }));
64
+ var vite = motionwindUnplugin.vite;
65
+ var rollup = motionwindUnplugin.rollup;
66
+ var webpack = motionwindUnplugin.webpack;
67
+ var rspack = motionwindUnplugin.rspack;
68
+ var esbuild = motionwindUnplugin.esbuild;
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ rollup
72
+ });
73
+ //# sourceMappingURL=rollup.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rollup.ts","../src/index.ts"],"sourcesContent":["export { rollup as default, rollup } from \"./index.js\";\n","import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,10 @@
1
+ import _default from './index.cjs';
2
+ // @ts-ignore
3
+ export = _default;
4
+ export { rollup } from './index.cjs';
5
+ import 'esbuild';
6
+ import 'webpack';
7
+ import 'rollup';
8
+ import 'vite';
9
+ import 'unplugin';
10
+ import 'motionwind-core';
@@ -0,0 +1,7 @@
1
+ export { rollup as default, rollup } from './index.js';
2
+ import 'esbuild';
3
+ import 'webpack';
4
+ import 'rollup';
5
+ import 'vite';
6
+ import 'unplugin';
7
+ import 'motionwind-core';
package/dist/rollup.js ADDED
@@ -0,0 +1,8 @@
1
+ import {
2
+ rollup
3
+ } from "./chunk-IIE2P3AO.js";
4
+ export {
5
+ rollup as default,
6
+ rollup
7
+ };
8
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/rspack.ts
31
+ var rspack_exports = {};
32
+ __export(rspack_exports, {
33
+ default: () => rspack,
34
+ rspack: () => rspack
35
+ });
36
+ module.exports = __toCommonJS(rspack_exports);
37
+
38
+ // src/index.ts
39
+ var import_core = require("@babel/core");
40
+ var import_unplugin = require("unplugin");
41
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
42
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
43
+ name: "motionwind",
44
+ enforce: "pre",
45
+ transformInclude(id) {
46
+ return (options.include ?? /\.[jt]sx$/).test(id);
47
+ },
48
+ transform(code, id) {
49
+ if (!code.includes("animate-")) return null;
50
+ const result = (0, import_core.transformSync)(code, {
51
+ plugins: [
52
+ [import_babel.default, options.config ?? {}],
53
+ "@babel/plugin-syntax-jsx"
54
+ ],
55
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
56
+ filename: id,
57
+ configFile: false,
58
+ babelrc: false,
59
+ sourceMaps: true
60
+ });
61
+ return result?.code ? { code: result.code, map: result.map } : null;
62
+ }
63
+ }));
64
+ var vite = motionwindUnplugin.vite;
65
+ var rollup = motionwindUnplugin.rollup;
66
+ var webpack = motionwindUnplugin.webpack;
67
+ var rspack = motionwindUnplugin.rspack;
68
+ var esbuild = motionwindUnplugin.esbuild;
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ rspack
72
+ });
73
+ //# sourceMappingURL=rspack.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rspack.ts","../src/index.ts"],"sourcesContent":["export { rspack as default, rspack } from \"./index.js\";\n","import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,10 @@
1
+ import _default from './index.cjs';
2
+ // @ts-ignore
3
+ export = _default;
4
+ export { rspack } from './index.cjs';
5
+ import 'esbuild';
6
+ import 'webpack';
7
+ import 'rollup';
8
+ import 'vite';
9
+ import 'unplugin';
10
+ import 'motionwind-core';
@@ -0,0 +1,7 @@
1
+ export { rspack as default, rspack } from './index.js';
2
+ import 'esbuild';
3
+ import 'webpack';
4
+ import 'rollup';
5
+ import 'vite';
6
+ import 'unplugin';
7
+ import 'motionwind-core';
package/dist/rspack.js ADDED
@@ -0,0 +1,8 @@
1
+ import {
2
+ rspack
3
+ } from "./chunk-IIE2P3AO.js";
4
+ export {
5
+ rspack as default,
6
+ rspack
7
+ };
8
+ //# sourceMappingURL=rspack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/vite.cjs ADDED
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/vite.ts
31
+ var vite_exports = {};
32
+ __export(vite_exports, {
33
+ default: () => vite,
34
+ vite: () => vite
35
+ });
36
+ module.exports = __toCommonJS(vite_exports);
37
+
38
+ // src/index.ts
39
+ var import_core = require("@babel/core");
40
+ var import_unplugin = require("unplugin");
41
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
42
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
43
+ name: "motionwind",
44
+ enforce: "pre",
45
+ transformInclude(id) {
46
+ return (options.include ?? /\.[jt]sx$/).test(id);
47
+ },
48
+ transform(code, id) {
49
+ if (!code.includes("animate-")) return null;
50
+ const result = (0, import_core.transformSync)(code, {
51
+ plugins: [
52
+ [import_babel.default, options.config ?? {}],
53
+ "@babel/plugin-syntax-jsx"
54
+ ],
55
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
56
+ filename: id,
57
+ configFile: false,
58
+ babelrc: false,
59
+ sourceMaps: true
60
+ });
61
+ return result?.code ? { code: result.code, map: result.map } : null;
62
+ }
63
+ }));
64
+ var vite = motionwindUnplugin.vite;
65
+ var rollup = motionwindUnplugin.rollup;
66
+ var webpack = motionwindUnplugin.webpack;
67
+ var rspack = motionwindUnplugin.rspack;
68
+ var esbuild = motionwindUnplugin.esbuild;
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ vite
72
+ });
73
+ //# sourceMappingURL=vite.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/vite.ts","../src/index.ts"],"sourcesContent":["export { vite as default, vite } from \"./index.js\";\n","import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,10 @@
1
+ import _default from './index.cjs';
2
+ // @ts-ignore
3
+ export = _default;
4
+ export { vite } from './index.cjs';
5
+ import 'esbuild';
6
+ import 'webpack';
7
+ import 'rollup';
8
+ import 'vite';
9
+ import 'unplugin';
10
+ import 'motionwind-core';
package/dist/vite.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { vite as default, vite } from './index.js';
2
+ import 'esbuild';
3
+ import 'webpack';
4
+ import 'rollup';
5
+ import 'vite';
6
+ import 'unplugin';
7
+ import 'motionwind-core';
package/dist/vite.js ADDED
@@ -0,0 +1,8 @@
1
+ import {
2
+ vite
3
+ } from "./chunk-IIE2P3AO.js";
4
+ export {
5
+ vite as default,
6
+ vite
7
+ };
8
+ //# sourceMappingURL=vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/webpack.ts
31
+ var webpack_exports = {};
32
+ __export(webpack_exports, {
33
+ default: () => webpack,
34
+ webpack: () => webpack
35
+ });
36
+ module.exports = __toCommonJS(webpack_exports);
37
+
38
+ // src/index.ts
39
+ var import_core = require("@babel/core");
40
+ var import_unplugin = require("unplugin");
41
+ var import_babel = __toESM(require("motionwind-react/babel"), 1);
42
+ var motionwindUnplugin = (0, import_unplugin.createUnplugin)((options = {}) => ({
43
+ name: "motionwind",
44
+ enforce: "pre",
45
+ transformInclude(id) {
46
+ return (options.include ?? /\.[jt]sx$/).test(id);
47
+ },
48
+ transform(code, id) {
49
+ if (!code.includes("animate-")) return null;
50
+ const result = (0, import_core.transformSync)(code, {
51
+ plugins: [
52
+ [import_babel.default, options.config ?? {}],
53
+ "@babel/plugin-syntax-jsx"
54
+ ],
55
+ parserOpts: id.endsWith(".tsx") ? { plugins: ["typescript", "jsx"] } : void 0,
56
+ filename: id,
57
+ configFile: false,
58
+ babelrc: false,
59
+ sourceMaps: true
60
+ });
61
+ return result?.code ? { code: result.code, map: result.map } : null;
62
+ }
63
+ }));
64
+ var vite = motionwindUnplugin.vite;
65
+ var rollup = motionwindUnplugin.rollup;
66
+ var webpack = motionwindUnplugin.webpack;
67
+ var rspack = motionwindUnplugin.rspack;
68
+ var esbuild = motionwindUnplugin.esbuild;
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ webpack
72
+ });
73
+ //# sourceMappingURL=webpack.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/webpack.ts","../src/index.ts"],"sourcesContent":["export { webpack as default, webpack } from \"./index.js\";\n","import { transformSync } from \"@babel/core\";\nimport { createUnplugin } from \"unplugin\";\nimport motionwindBabelPlugin from \"motionwind-react/babel\";\nimport type { MotionwindConfig } from \"motionwind-core\";\n\nexport interface MotionwindUnpluginOptions {\n config?: MotionwindConfig;\n include?: RegExp;\n}\n\nexport const motionwindUnplugin = createUnplugin<\n MotionwindUnpluginOptions | undefined\n>((options = {}) => ({\n name: \"motionwind\",\n enforce: \"pre\",\n transformInclude(id) {\n return (options.include ?? /\\.[jt]sx$/).test(id);\n },\n transform(code, id) {\n if (!code.includes(\"animate-\")) return null;\n const result = transformSync(code, {\n plugins: [\n [motionwindBabelPlugin, options.config ?? {}],\n \"@babel/plugin-syntax-jsx\",\n ],\n parserOpts: id.endsWith(\".tsx\")\n ? { plugins: [\"typescript\", \"jsx\"] }\n : undefined,\n filename: id,\n configFile: false,\n babelrc: false,\n sourceMaps: true,\n });\n return result?.code ? { code: result.code, map: result.map } : null;\n },\n}));\n\nexport const vite = motionwindUnplugin.vite;\nexport const rollup = motionwindUnplugin.rollup;\nexport const webpack = motionwindUnplugin.webpack;\nexport const rspack = motionwindUnplugin.rspack;\nexport const esbuild = motionwindUnplugin.esbuild;\n\nexport default motionwindUnplugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA8B;AAC9B,sBAA+B;AAC/B,mBAAkC;AAQ3B,IAAM,yBAAqB,gCAEhC,CAAC,UAAU,CAAC,OAAO;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AAAA,EACT,iBAAiB,IAAI;AACnB,YAAQ,QAAQ,WAAW,aAAa,KAAK,EAAE;AAAA,EACjD;AAAA,EACA,UAAU,MAAM,IAAI;AAClB,QAAI,CAAC,KAAK,SAAS,UAAU,EAAG,QAAO;AACvC,UAAM,aAAS,2BAAc,MAAM;AAAA,MACjC,SAAS;AAAA,QACP,CAAC,aAAAA,SAAuB,QAAQ,UAAU,CAAC,CAAC;AAAA,QAC5C;AAAA,MACF;AAAA,MACA,YAAY,GAAG,SAAS,MAAM,IAC1B,EAAE,SAAS,CAAC,cAAc,KAAK,EAAE,IACjC;AAAA,MACJ,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,YAAY;AAAA,IACd,CAAC;AACD,WAAO,QAAQ,OAAO,EAAE,MAAM,OAAO,MAAM,KAAK,OAAO,IAAI,IAAI;AAAA,EACjE;AACF,EAAE;AAEK,IAAM,OAAO,mBAAmB;AAChC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;AACnC,IAAM,SAAS,mBAAmB;AAClC,IAAM,UAAU,mBAAmB;","names":["motionwindBabelPlugin"]}
@@ -0,0 +1,10 @@
1
+ import _default from './index.cjs';
2
+ // @ts-ignore
3
+ export = _default;
4
+ export { webpack } from './index.cjs';
5
+ import 'esbuild';
6
+ import 'webpack';
7
+ import 'rollup';
8
+ import 'vite';
9
+ import 'unplugin';
10
+ import 'motionwind-core';
@@ -0,0 +1,7 @@
1
+ export { webpack as default, webpack } from './index.js';
2
+ import 'esbuild';
3
+ import 'webpack';
4
+ import 'rollup';
5
+ import 'vite';
6
+ import 'unplugin';
7
+ import 'motionwind-core';
@@ -0,0 +1,8 @@
1
+ import {
2
+ webpack
3
+ } from "./chunk-IIE2P3AO.js";
4
+ export {
5
+ webpack as default,
6
+ webpack
7
+ };
8
+ //# sourceMappingURL=webpack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "motionwind-unplugin",
3
+ "version": "2.1.0",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "description": "Shared Motionwind compiler integration for Vite, Rollup, webpack, Rspack, and esbuild.",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/piyushzingade/motionwind.git",
11
+ "directory": "packages/motionwind-unplugin"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./vite": {
19
+ "import": "./dist/vite.js",
20
+ "require": "./dist/vite.cjs"
21
+ },
22
+ "./rollup": {
23
+ "import": "./dist/rollup.js",
24
+ "require": "./dist/rollup.cjs"
25
+ },
26
+ "./webpack": {
27
+ "import": "./dist/webpack.js",
28
+ "require": "./dist/webpack.cjs"
29
+ },
30
+ "./rspack": {
31
+ "import": "./dist/rspack.js",
32
+ "require": "./dist/rspack.cjs"
33
+ },
34
+ "./esbuild": {
35
+ "import": "./dist/esbuild.js",
36
+ "require": "./dist/esbuild.cjs"
37
+ }
38
+ },
39
+ "main": "./dist/index.cjs",
40
+ "module": "./dist/index.js",
41
+ "types": "./dist/index.d.ts",
42
+ "files": [
43
+ "dist"
44
+ ],
45
+ "scripts": {
46
+ "build": "tsup",
47
+ "dev": "tsup --watch",
48
+ "test": "vitest run --passWithNoTests",
49
+ "lint": "eslint --max-warnings 0",
50
+ "check-types": "tsc --noEmit"
51
+ },
52
+ "dependencies": {
53
+ "@babel/core": "^7.26.0",
54
+ "motionwind-core": "^2.1.0",
55
+ "motionwind-react": "^2.1.0",
56
+ "unplugin": "^2.3.5"
57
+ },
58
+ "devDependencies": {
59
+ "@repo/eslint-config": "*",
60
+ "@repo/typescript-config": "*",
61
+ "@types/babel__core": "^7.20.5",
62
+ "eslint": "^9.39.1",
63
+ "tsup": "^8.5.0",
64
+ "typescript": "5.9.2",
65
+ "vitest": "^3.2.1"
66
+ },
67
+ "publishConfig": {
68
+ "access": "public"
69
+ }
70
+ }