@navita/next-plugin 0.4.2 → 0.4.4
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/fromServerLoader.cjs +1 -1
- package/index.cjs +3 -3
- package/optimizeCSSOutput.cjs +4 -4
- package/package.json +2 -2
package/fromServerLoader.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var webpackPlugin = require('@navita/webpack-plugin');
|
|
|
5
5
|
function pitch() {
|
|
6
6
|
this._module.loaders = [];
|
|
7
7
|
const dependency = webpackPlugin.getNavitaDependency(this._compiler.webpack);
|
|
8
|
-
const { cssHash
|
|
8
|
+
const { cssHash, issuerPath } = Object.fromEntries(new URLSearchParams(this.resourceQuery).entries());
|
|
9
9
|
this._module.addDependency(new dependency(issuerPath, cssHash));
|
|
10
10
|
// We set the layer to something other than WEBPACK_LAYERS.appPagesBrowser to
|
|
11
11
|
// not have the modules included in the next pageManifest.
|
package/index.cjs
CHANGED
|
@@ -31,12 +31,12 @@ let lastCache;
|
|
|
31
31
|
const MiniCssExtractPlugin = NextMiniCssExtractPluginDefault['default'];
|
|
32
32
|
const createNavitaStylePlugin = (navitaConfig = {})=>(nextConfig)=>Object.assign({}, nextConfig, {
|
|
33
33
|
webpack (config, options) {
|
|
34
|
-
const { dir
|
|
34
|
+
const { dir, dev } = options;
|
|
35
35
|
config.plugins?.push({
|
|
36
36
|
apply (compiler) {
|
|
37
37
|
// We call the getNavitaModule function here
|
|
38
38
|
// so that NavitaModule is created with what's required for the next.js rsc to client entry promotion:
|
|
39
|
-
webpackPlugin.getNavitaModule(compiler.webpack, ({ cssHash
|
|
39
|
+
webpackPlugin.getNavitaModule(compiler.webpack, ({ cssHash, issuerPath })=>({
|
|
40
40
|
// The resourceResolveData is used by next.js to promote server and ssr entries to client entries:
|
|
41
41
|
// https://github.com/vercel/next.js/blob/f3132354285fb18c290bf9aad7f8dc7e0550105d/packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts#L590
|
|
42
42
|
resourceResolveData: {
|
|
@@ -89,7 +89,7 @@ const createNavitaStylePlugin = (navitaConfig = {})=>(nextConfig)=>Object.assign
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
// Next.js creates at least three webpack instances. We can't rely on the webpack cache.
|
|
92
|
-
const { cache
|
|
92
|
+
const { cache, mode } = config;
|
|
93
93
|
const cacheDirectory = typeof cache !== "boolean" && cache.type === "filesystem" ? path.resolve(cache.cacheDirectory, `navita-${mode}`) : undefined;
|
|
94
94
|
const cacheDestination = path.resolve(cacheDirectory, 'data.txt');
|
|
95
95
|
const onRenderInitialized = async (createdRenderer)=>{
|
package/optimizeCSSOutput.cjs
CHANGED
|
@@ -10,9 +10,9 @@ const merge = (...merge)=>{
|
|
|
10
10
|
];
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
for(const
|
|
14
|
-
result[
|
|
15
|
-
...new Set(result[
|
|
13
|
+
for(const key in result){
|
|
14
|
+
result[key] = [
|
|
15
|
+
...new Set(result[key])
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
18
|
return result;
|
|
@@ -42,7 +42,7 @@ function optimizeCSSOutput(output) {
|
|
|
42
42
|
x
|
|
43
43
|
]));
|
|
44
44
|
const getAllParentUsedIds = (chunk)=>{
|
|
45
|
-
const { name: route
|
|
45
|
+
const { name: route } = chunk;
|
|
46
46
|
if (!route) {
|
|
47
47
|
// If we don't have a name, it's a dynamic chunk.
|
|
48
48
|
const value = output.get(chunk);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navita/next-plugin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Next.js integration for Navita",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"next",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"browserslist": "^4.21.5",
|
|
28
|
-
"@navita/webpack-plugin": "0.4.
|
|
28
|
+
"@navita/webpack-plugin": "0.4.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"next": ">=12 || >=13",
|