Skip to content

Commit

Permalink
Fix error when intializing next plugin (#1148)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed Jul 25, 2023
1 parent 1860952 commit b279bb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-starfishes-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vanilla-extract/next-plugin': patch
---

Fix error when intializing plugin
7 changes: 2 additions & 5 deletions packages/next-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ import { VanillaExtractPlugin } from '@vanilla-extract/webpack-plugin';
import browserslist from 'browserslist';
import { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css';
import { findPagesDir } from 'next/dist/lib/find-pages-dir';
import nextMiniCssExtractPluginExports from 'next/dist/build/webpack/plugins/mini-css-extract-plugin';
import NextMiniCssExtractPluginDefault from 'next/dist/build/webpack/plugins/mini-css-extract-plugin';

import type webpack from 'webpack';
import type { NextConfig } from 'next/types';
import type { WebpackConfigContext } from 'next/dist/server/config-shared';

// Next.js' built-in mini-css-extract-plugin has a very terrible type definition, let's just use any
const NextMiniCssExtractPlugin: any =
// @ts-expect-error -- Next.js' precompilation does add "__esModule: true", but doesn't add an actual default exports
nextMiniCssExtractPluginExports.default;
const NextMiniCssExtractPlugin = NextMiniCssExtractPluginDefault as any;

function getSupportedBrowsers(dir: any, isDevelopment: any) {
let browsers;
Expand Down

0 comments on commit b279bb5

Please sign in to comment.