@vanilla-extract/next-plugin 2.2.0 → 2.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.
@@ -6,17 +6,15 @@ var webpackPlugin = require('@vanilla-extract/webpack-plugin');
6
6
  var browserslist = require('browserslist');
7
7
  var css = require('next/dist/build/webpack/config/blocks/css');
8
8
  var findPagesDir = require('next/dist/lib/find-pages-dir');
9
- var nextMiniCssExtractPluginExports = require('next/dist/build/webpack/plugins/mini-css-extract-plugin');
9
+ var fileResolve = require('next/dist/build/webpack/config/blocks/css/loaders/file-resolve');
10
+ var NextMiniCssExtractPluginDefault = require('next/dist/build/webpack/plugins/mini-css-extract-plugin');
10
11
 
11
12
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
12
13
 
13
14
  var browserslist__default = /*#__PURE__*/_interopDefault(browserslist);
14
- var nextMiniCssExtractPluginExports__default = /*#__PURE__*/_interopDefault(nextMiniCssExtractPluginExports);
15
+ var NextMiniCssExtractPluginDefault__default = /*#__PURE__*/_interopDefault(NextMiniCssExtractPluginDefault);
15
16
 
16
- // Next.js' built-in mini-css-extract-plugin has a very terrible type definition, let's just use any
17
- const NextMiniCssExtractPlugin =
18
- // @ts-expect-error -- Next.js' precompilation does add "__esModule: true", but doesn't add an actual default exports
19
- nextMiniCssExtractPluginExports__default["default"].default;
17
+ const NextMiniCssExtractPlugin = NextMiniCssExtractPluginDefault__default["default"];
20
18
  function getSupportedBrowsers(dir, isDevelopment) {
21
19
  let browsers;
22
20
  try {
@@ -53,7 +51,15 @@ const getVanillaExtractCssLoaders = (options, assetPrefix) => {
53
51
  options: {
54
52
  postcss,
55
53
  importLoaders: 1,
56
- modules: false
54
+ modules: false,
55
+ url: (url, resourcePath) => {
56
+ var _options$config$exper;
57
+ return fileResolve.cssFileResolve(url, resourcePath, (_options$config$exper = options.config.experimental) === null || _options$config$exper === void 0 ? void 0 : _options$config$exper.urlImports);
58
+ },
59
+ import: (url, _, resourcePath) => {
60
+ var _options$config$exper2;
61
+ return fileResolve.cssFileResolve(url, resourcePath, (_options$config$exper2 = options.config.experimental) === null || _options$config$exper2 === void 0 ? void 0 : _options$config$exper2.urlImports);
62
+ }
57
63
  }
58
64
  });
59
65
 
@@ -6,17 +6,15 @@ var webpackPlugin = require('@vanilla-extract/webpack-plugin');
6
6
  var browserslist = require('browserslist');
7
7
  var css = require('next/dist/build/webpack/config/blocks/css');
8
8
  var findPagesDir = require('next/dist/lib/find-pages-dir');
9
- var nextMiniCssExtractPluginExports = require('next/dist/build/webpack/plugins/mini-css-extract-plugin');
9
+ var fileResolve = require('next/dist/build/webpack/config/blocks/css/loaders/file-resolve');
10
+ var NextMiniCssExtractPluginDefault = require('next/dist/build/webpack/plugins/mini-css-extract-plugin');
10
11
 
11
12
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
12
13
 
13
14
  var browserslist__default = /*#__PURE__*/_interopDefault(browserslist);
14
- var nextMiniCssExtractPluginExports__default = /*#__PURE__*/_interopDefault(nextMiniCssExtractPluginExports);
15
+ var NextMiniCssExtractPluginDefault__default = /*#__PURE__*/_interopDefault(NextMiniCssExtractPluginDefault);
15
16
 
16
- // Next.js' built-in mini-css-extract-plugin has a very terrible type definition, let's just use any
17
- const NextMiniCssExtractPlugin =
18
- // @ts-expect-error -- Next.js' precompilation does add "__esModule: true", but doesn't add an actual default exports
19
- nextMiniCssExtractPluginExports__default["default"].default;
17
+ const NextMiniCssExtractPlugin = NextMiniCssExtractPluginDefault__default["default"];
20
18
  function getSupportedBrowsers(dir, isDevelopment) {
21
19
  let browsers;
22
20
  try {
@@ -53,7 +51,15 @@ const getVanillaExtractCssLoaders = (options, assetPrefix) => {
53
51
  options: {
54
52
  postcss,
55
53
  importLoaders: 1,
56
- modules: false
54
+ modules: false,
55
+ url: (url, resourcePath) => {
56
+ var _options$config$exper;
57
+ return fileResolve.cssFileResolve(url, resourcePath, (_options$config$exper = options.config.experimental) === null || _options$config$exper === void 0 ? void 0 : _options$config$exper.urlImports);
58
+ },
59
+ import: (url, _, resourcePath) => {
60
+ var _options$config$exper2;
61
+ return fileResolve.cssFileResolve(url, resourcePath, (_options$config$exper2 = options.config.experimental) === null || _options$config$exper2 === void 0 ? void 0 : _options$config$exper2.urlImports);
62
+ }
57
63
  }
58
64
  });
59
65
 
@@ -2,12 +2,10 @@ import { VanillaExtractPlugin } from '@vanilla-extract/webpack-plugin';
2
2
  import browserslist from 'browserslist';
3
3
  import { lazyPostCSS } from 'next/dist/build/webpack/config/blocks/css';
4
4
  import { findPagesDir } from 'next/dist/lib/find-pages-dir';
5
- import nextMiniCssExtractPluginExports from 'next/dist/build/webpack/plugins/mini-css-extract-plugin';
5
+ import { cssFileResolve } from 'next/dist/build/webpack/config/blocks/css/loaders/file-resolve';
6
+ import NextMiniCssExtractPluginDefault from 'next/dist/build/webpack/plugins/mini-css-extract-plugin';
6
7
 
7
- // Next.js' built-in mini-css-extract-plugin has a very terrible type definition, let's just use any
8
- const NextMiniCssExtractPlugin =
9
- // @ts-expect-error -- Next.js' precompilation does add "__esModule: true", but doesn't add an actual default exports
10
- nextMiniCssExtractPluginExports.default;
8
+ const NextMiniCssExtractPlugin = NextMiniCssExtractPluginDefault;
11
9
  function getSupportedBrowsers(dir, isDevelopment) {
12
10
  let browsers;
13
11
  try {
@@ -44,7 +42,15 @@ const getVanillaExtractCssLoaders = (options, assetPrefix) => {
44
42
  options: {
45
43
  postcss,
46
44
  importLoaders: 1,
47
- modules: false
45
+ modules: false,
46
+ url: (url, resourcePath) => {
47
+ var _options$config$exper;
48
+ return cssFileResolve(url, resourcePath, (_options$config$exper = options.config.experimental) === null || _options$config$exper === void 0 ? void 0 : _options$config$exper.urlImports);
49
+ },
50
+ import: (url, _, resourcePath) => {
51
+ var _options$config$exper2;
52
+ return cssFileResolve(url, resourcePath, (_options$config$exper2 = options.config.experimental) === null || _options$config$exper2 === void 0 ? void 0 : _options$config$exper2.urlImports);
53
+ }
48
54
  }
49
55
  });
50
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanilla-extract/next-plugin",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
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",