Skip to content

Commit

Permalink
fix: embed webpack-virtual-modules to the project
Browse files Browse the repository at this point in the history
pnpm patch doesn't work when we publish the package...
  • Loading branch information
dlehmhus committed Nov 10, 2022
1 parent ae958fb commit 9e21948
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## What is this?

The new Next.js 13 app directory feature doesn't work with the [@linaria/webpack5-loader](https://github.com/callstack/linaria/tree/master/packages/webpack5-loader) anymore, therefore the [next-linaria](https://github.com/Mistereo/next-linaria) package sadly also doesn't work. This package tries to solve that issue with a custom linaria webpack loader and [Webpack Virtual Modules](https://github.com/sysgears/webpack-virtual-modules).
The new Next.js 13 app directory feature doesn't work with the [@linaria/webpack5-loader](https://github.com/callstack/linaria/tree/master/packages/webpack5-loader) anymore, therefore the [next-linaria](https://github.com/Mistereo/next-linaria) package sadly also doesn't work. This package solves that issue with a custom linaria webpack loader and [Webpack Virtual Modules](https://github.com/sysgears/webpack-virtual-modules).

## Disclaimer

Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@linaria/babel-preset": "4.3.0",
"@typescript-eslint/eslint-plugin": "5.42.1",
"@typescript-eslint/parser": "5.42.1",
"eslint": "8.27.0",
Expand All @@ -27,21 +28,14 @@
"prettier": "2.7.1",
"simple-git-hooks": "2.8.1",
"typescript": "4.8.4",
"webpack": "5.75.0",
"@linaria/babel-preset": "4.3.0"
"webpack": "5.75.0"
},
"peerDependencies": {
"@linaria/babel-preset": "4.x",
"webpack": "5.x"
},
"dependencies": {
"file-system-cache": "2.0.1",
"webpack-virtual-modules": "0.4.6"
},
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
}
"file-system-cache": "2.0.1"
},
"files": [
"lib"
Expand Down
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/VirtualModuleStore.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Cache, { type FileSystemCache } from 'file-system-cache';
import path from 'path';
import type * as Webpack from 'webpack';
import VirtualModulesPlugin from 'webpack-virtual-modules';

import { isFSCache } from './utils';
import VirtualModulesPlugin from './webpack-virtual-modules';

type CachedFile = {
path: string;
Expand Down
Loading

0 comments on commit 9e21948

Please sign in to comment.