@atomic-variants/next-plugin 0.2.1 → 0.2.2

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.cjs CHANGED
@@ -1 +1 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@atomic-variants/webpack-plugin`);c=s(c);let l=require(`path`);l=s(l);const u=`__atomic_generated`,d=RegExp(`/\\*\\s*${u}:([^*]+)\\s*\\*/`,`g`);function f(e){return{...e,webpack:(t,n)=>(t.plugins?.push(new c.default({filePath:l.default.resolve(__dirname,`../atomic-variants.css`)})),typeof e.webpack==`function`?e.webpack(t,n):t),experimental:{...e.experimental,swcPlugins:[...e.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:u}]]}}}exports.withAtomicVariants=f;
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@atomic-variants/webpack-plugin`);c=s(c);const l=`__atomic_generated`,u=RegExp(`/\\*\\s*${l}:([^*]+)\\s*\\*/`,`g`);function d(e){return{...e,webpack:(t,n)=>(t.plugins?.push(new c.default({filePath:new URL(`../atomic-variants.css`,require(`url`).pathToFileURL(__filename).href).pathname})),typeof e.webpack==`function`?e.webpack(t,n):t),experimental:{...e.experimental,swcPlugins:[...e.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:l}]]}}}exports.withAtomicVariants=d;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import e from"@atomic-variants/webpack-plugin";import t from"path";const n=`__atomic_generated`;RegExp(`/\\*\\s*${n}:([^*]+)\\s*\\*/`,`g`);function r(r){return{...r,webpack:(n,i)=>(n.plugins?.push(new e({filePath:t.resolve(__dirname,`../atomic-variants.css`)})),typeof r.webpack==`function`?r.webpack(n,i):n),experimental:{...r.experimental,swcPlugins:[...r.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:n}]]}}}export{r as withAtomicVariants};
1
+ import e from"@atomic-variants/webpack-plugin";const t=`__atomic_generated`;RegExp(`/\\*\\s*${t}:([^*]+)\\s*\\*/`,`g`);function n(n){return{...n,webpack:(t,r)=>(t.plugins?.push(new e({filePath:new URL(`../atomic-variants.css`,import.meta.url).pathname})),typeof n.webpack==`function`?n.webpack(t,r):t),experimental:{...n.experimental,swcPlugins:[...n.experimental?.swcPlugins||[],[`@atomic-variants/swc-plugin`,{tag:t}]]}}}export{n as withAtomicVariants};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-variants/next-plugin",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Next.js plugin for atomic-variants to enable responsive, type-safe TailwindCSS variants at build time.",
5
5
  "keywords": [
6
6
  "atomic-variants",
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ATOMIC_TAG } from "@atomic-variants/constants";
2
2
  import AtomicVariantsPlugin from "@atomic-variants/webpack-plugin";
3
3
  import type { NextConfig } from "next";
4
- import path from "path";
5
4
 
6
5
  export function withAtomicVariants(nextConfig: NextConfig) {
7
6
  return {
@@ -9,7 +8,7 @@ export function withAtomicVariants(nextConfig: NextConfig) {
9
8
  webpack: (webpackConfig, options) => {
10
9
  webpackConfig.plugins?.push(
11
10
  new AtomicVariantsPlugin({
12
- filePath: path.resolve(__dirname, "../atomic-variants.css"),
11
+ filePath: new URL("../atomic-variants.css", import.meta.url).pathname,
13
12
  })
14
13
  );
15
14