@vanilla-extract/next-plugin 2.3.1 → 2.3.3

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vanilla-extract-next-plugin.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -87,7 +87,7 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
87
87
  return (nextConfig = {}) => ({
88
88
  ...nextConfig,
89
89
  webpack(config, options) {
90
- var _resolvedNextConfig$e, _resolvedNextConfig$e2, _resolvedNextConfig$e3;
90
+ var _resolvedNextConfig$e;
91
91
  const {
92
92
  dir,
93
93
  dev,
@@ -99,8 +99,9 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
99
99
  // https://github.com/vercel/next.js/blob/1fb4cad2a8329811b5ccde47217b4a6ae739124e/packages/next/build/webpack-config.ts#L626
100
100
  // https://github.com/vercel/next.js/pull/43916
101
101
  // on Next.js 12, findPagesDirResult is a string. on Next.js 13, findPagesDirResult is an object
102
- const findPagesDirResult = findPagesDir.findPagesDir(dir, (_resolvedNextConfig$e = (_resolvedNextConfig$e2 = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e2 === void 0 ? void 0 : _resolvedNextConfig$e2.appDir) !== null && _resolvedNextConfig$e !== void 0 ? _resolvedNextConfig$e : false);
103
- const hasAppDir = !!((_resolvedNextConfig$e3 = resolvedNextConfig.experimental) !== null && _resolvedNextConfig$e3 !== void 0 && _resolvedNextConfig$e3.appDir) && !!(findPagesDirResult && findPagesDirResult.appDir);
102
+ const findPagesDirResult = findPagesDir.findPagesDir(dir, ((_resolvedNextConfig$e = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e === void 0 ? void 0 : _resolvedNextConfig$e.appDir) ?? false);
103
+ // Skip nextConfig check since appDir is stable feature after Next.js 13.4
104
+ const hasAppDir = !!(findPagesDirResult && findPagesDirResult.appDir);
104
105
  const outputCss = hasAppDir ?
105
106
  // Always output css since Next.js App Router needs to collect Server CSS from React Server Components
106
107
  true :
@@ -87,7 +87,7 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
87
87
  return (nextConfig = {}) => ({
88
88
  ...nextConfig,
89
89
  webpack(config, options) {
90
- var _resolvedNextConfig$e, _resolvedNextConfig$e2, _resolvedNextConfig$e3;
90
+ var _resolvedNextConfig$e;
91
91
  const {
92
92
  dir,
93
93
  dev,
@@ -99,8 +99,9 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
99
99
  // https://github.com/vercel/next.js/blob/1fb4cad2a8329811b5ccde47217b4a6ae739124e/packages/next/build/webpack-config.ts#L626
100
100
  // https://github.com/vercel/next.js/pull/43916
101
101
  // on Next.js 12, findPagesDirResult is a string. on Next.js 13, findPagesDirResult is an object
102
- const findPagesDirResult = findPagesDir.findPagesDir(dir, (_resolvedNextConfig$e = (_resolvedNextConfig$e2 = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e2 === void 0 ? void 0 : _resolvedNextConfig$e2.appDir) !== null && _resolvedNextConfig$e !== void 0 ? _resolvedNextConfig$e : false);
103
- const hasAppDir = !!((_resolvedNextConfig$e3 = resolvedNextConfig.experimental) !== null && _resolvedNextConfig$e3 !== void 0 && _resolvedNextConfig$e3.appDir) && !!(findPagesDirResult && findPagesDirResult.appDir);
102
+ const findPagesDirResult = findPagesDir.findPagesDir(dir, ((_resolvedNextConfig$e = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e === void 0 ? void 0 : _resolvedNextConfig$e.appDir) ?? false);
103
+ // Skip nextConfig check since appDir is stable feature after Next.js 13.4
104
+ const hasAppDir = !!(findPagesDirResult && findPagesDirResult.appDir);
104
105
  const outputCss = hasAppDir ?
105
106
  // Always output css since Next.js App Router needs to collect Server CSS from React Server Components
106
107
  true :
@@ -78,7 +78,7 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
78
78
  return (nextConfig = {}) => ({
79
79
  ...nextConfig,
80
80
  webpack(config, options) {
81
- var _resolvedNextConfig$e, _resolvedNextConfig$e2, _resolvedNextConfig$e3;
81
+ var _resolvedNextConfig$e;
82
82
  const {
83
83
  dir,
84
84
  dev,
@@ -90,8 +90,9 @@ const createVanillaExtractPlugin = (pluginOptions = {}) => {
90
90
  // https://github.com/vercel/next.js/blob/1fb4cad2a8329811b5ccde47217b4a6ae739124e/packages/next/build/webpack-config.ts#L626
91
91
  // https://github.com/vercel/next.js/pull/43916
92
92
  // on Next.js 12, findPagesDirResult is a string. on Next.js 13, findPagesDirResult is an object
93
- const findPagesDirResult = findPagesDir(dir, (_resolvedNextConfig$e = (_resolvedNextConfig$e2 = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e2 === void 0 ? void 0 : _resolvedNextConfig$e2.appDir) !== null && _resolvedNextConfig$e !== void 0 ? _resolvedNextConfig$e : false);
94
- const hasAppDir = !!((_resolvedNextConfig$e3 = resolvedNextConfig.experimental) !== null && _resolvedNextConfig$e3 !== void 0 && _resolvedNextConfig$e3.appDir) && !!(findPagesDirResult && findPagesDirResult.appDir);
93
+ const findPagesDirResult = findPagesDir(dir, ((_resolvedNextConfig$e = resolvedNextConfig.experimental) === null || _resolvedNextConfig$e === void 0 ? void 0 : _resolvedNextConfig$e.appDir) ?? false);
94
+ // Skip nextConfig check since appDir is stable feature after Next.js 13.4
95
+ const hasAppDir = !!(findPagesDirResult && findPagesDirResult.appDir);
95
96
  const outputCss = hasAppDir ?
96
97
  // Always output css since Next.js App Router needs to collect Server CSS from React Server Components
97
98
  true :
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/next-plugin",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "Zero-runtime Stylesheets-in-TypeScript",
5
5
  "main": "dist/vanilla-extract-next-plugin.cjs.js",
6
6
  "module": "dist/vanilla-extract-next-plugin.esm.js",
@@ -20,7 +20,7 @@
20
20
  "author": "SEEK",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@vanilla-extract/webpack-plugin": "^2.3.1"
23
+ "@vanilla-extract/webpack-plugin": "^2.3.2"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "next": ">=12.1.7"