next-with-linaria 1.3.0 → 1.4.0
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/README.md +1 -1
- package/lib/add-turbopack-config.d.ts +1 -0
- package/lib/add-webpack-config.d.ts +1 -0
- package/lib/loaders/webpack-transform-loader.js +55 -11
- package/lib/loaders/webpack-transform-loader.js.map +1 -1
- package/lib/with-linaria.d.ts +1 -251
- package/lib/with-linaria.js +4 -7
- package/lib/with-linaria.js.map +1 -1
- package/package.json +21 -25
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ const config: LinariaConfig = {
|
|
|
69
69
|
},
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export default withRspack(
|
|
72
|
+
export default withLinaria(withRspack(config));
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Now you can use linaria in all the places where Next.js also allows you to use [CSS Modules](https://beta.nextjs.org/docs/styling/css-modules). That currently means in every file in the `app` directory and the `pages` directory.
|
|
@@ -22,6 +22,44 @@ const insert_import_1 = require("../utils/insert-import");
|
|
|
22
22
|
const source_map_1 = require("../utils/source-map");
|
|
23
23
|
const consts_1 = require("./consts");
|
|
24
24
|
const cache = new transform_1.TransformCacheCollection();
|
|
25
|
+
const resolvers = {};
|
|
26
|
+
const stripQueryAndHash = (request) => {
|
|
27
|
+
const queryIdx = request.indexOf('?');
|
|
28
|
+
const hashIdx = request.indexOf('#');
|
|
29
|
+
if (queryIdx === -1)
|
|
30
|
+
return hashIdx === -1 ? request : request.slice(0, hashIdx);
|
|
31
|
+
if (hashIdx === -1)
|
|
32
|
+
return request.slice(0, queryIdx);
|
|
33
|
+
return request.slice(0, Math.min(queryIdx, hashIdx));
|
|
34
|
+
};
|
|
35
|
+
const getResolverKey = (importer, stack) => {
|
|
36
|
+
const root = stack.length ? stack[stack.length - 1] : importer;
|
|
37
|
+
return stripQueryAndHash(root);
|
|
38
|
+
};
|
|
39
|
+
const asyncResolve = (what, importer, stack = [importer]) => {
|
|
40
|
+
const key = getResolverKey(importer, stack);
|
|
41
|
+
const resolver = resolvers[key];
|
|
42
|
+
if (!resolver || resolver.length === 0) {
|
|
43
|
+
throw new Error(`No resolver found for ${key}`);
|
|
44
|
+
}
|
|
45
|
+
return Promise.all(resolver.map((r) => r(what, importer, stack))).then((results) => {
|
|
46
|
+
const firstResult = results[0];
|
|
47
|
+
if (results.some((r) => r !== firstResult)) {
|
|
48
|
+
throw new Error('Resolvers returned different results');
|
|
49
|
+
}
|
|
50
|
+
return firstResult;
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
function addResolver(resourcePath, resolver) {
|
|
54
|
+
const key = stripQueryAndHash(resourcePath);
|
|
55
|
+
if (!resolvers[key]) {
|
|
56
|
+
resolvers[key] = [];
|
|
57
|
+
}
|
|
58
|
+
resolvers[key].push(resolver);
|
|
59
|
+
return () => {
|
|
60
|
+
resolvers[key] = resolvers[key].filter((r) => r !== resolver);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
25
63
|
const webpackTransformLoader = function (content, inputSourceMap) {
|
|
26
64
|
this.async();
|
|
27
65
|
const _a = this.getOptions() || {}, { fastCheck = true, prefixer = true } = _a, pluginOptions = __rest(_a, ["fastCheck", "prefixer"]);
|
|
@@ -30,26 +68,29 @@ const webpackTransformLoader = function (content, inputSourceMap) {
|
|
|
30
68
|
this.callback(null, contentStr, inputSourceMap);
|
|
31
69
|
return;
|
|
32
70
|
}
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
71
|
+
const removeResolver = addResolver(this.resourcePath, (what, importer) => {
|
|
72
|
+
const importerPath = stripQueryAndHash(importer);
|
|
73
|
+
const context = path_1.default.isAbsolute(importerPath)
|
|
74
|
+
? path_1.default.dirname(importerPath)
|
|
75
|
+
: path_1.default.join(process.cwd(), path_1.default.dirname(importerPath));
|
|
37
76
|
return new Promise((resolve, reject) => {
|
|
38
|
-
this.resolve(context,
|
|
77
|
+
this.resolve(context, what, (err, result) => {
|
|
39
78
|
if (err) {
|
|
40
|
-
console.error(err);
|
|
41
79
|
reject(err);
|
|
42
80
|
}
|
|
43
81
|
else if (result) {
|
|
44
|
-
|
|
82
|
+
const filePath = stripQueryAndHash(result);
|
|
83
|
+
if (path_1.default.isAbsolute(filePath)) {
|
|
84
|
+
this.addDependency(filePath);
|
|
85
|
+
}
|
|
45
86
|
resolve(result);
|
|
46
87
|
}
|
|
47
88
|
else {
|
|
48
|
-
reject(new Error(`Cannot resolve ${
|
|
89
|
+
reject(new Error(`Cannot resolve ${what}`));
|
|
49
90
|
}
|
|
50
91
|
});
|
|
51
92
|
});
|
|
52
|
-
};
|
|
93
|
+
});
|
|
53
94
|
const filename = path_1.default.basename(this.resourcePath, path_1.default.extname(this.resourcePath));
|
|
54
95
|
const transformServices = {
|
|
55
96
|
options: {
|
|
@@ -61,7 +102,8 @@ const webpackTransformLoader = function (content, inputSourceMap) {
|
|
|
61
102
|
},
|
|
62
103
|
cache,
|
|
63
104
|
};
|
|
64
|
-
(0, transform_1.transform)(transformServices, contentStr, asyncResolve)
|
|
105
|
+
(0, transform_1.transform)(transformServices, contentStr, asyncResolve)
|
|
106
|
+
.then(async (result) => {
|
|
65
107
|
var _a, _b, _c, _d;
|
|
66
108
|
if (result.cssText) {
|
|
67
109
|
const { cssText } = result;
|
|
@@ -86,7 +128,9 @@ const webpackTransformLoader = function (content, inputSourceMap) {
|
|
|
86
128
|
return;
|
|
87
129
|
}
|
|
88
130
|
this.callback(null, result.code, (_d = result.sourceMap) !== null && _d !== void 0 ? _d : undefined);
|
|
89
|
-
}
|
|
131
|
+
})
|
|
132
|
+
.catch((err) => this.callback(err))
|
|
133
|
+
.finally(removeResolver);
|
|
90
134
|
};
|
|
91
135
|
exports.default = webpackTransformLoader;
|
|
92
136
|
//# sourceMappingURL=webpack-transform-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-transform-loader.js","sourceRoot":"","sources":["../../src/loaders/webpack-transform-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,0DAA6B;AAG7B,oDAA2E;AAE3E,gDAAwB;AAGxB,oDAAuD;AACvD,0DAA+D;AAC/D,oDAAuD;AACvD,qCAA8E;AAsB9E,MAAM,KAAK,GAAG,IAAI,oCAAwB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"webpack-transform-loader.js","sourceRoot":"","sources":["../../src/loaders/webpack-transform-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,0DAA6B;AAG7B,oDAA2E;AAE3E,gDAAwB;AAGxB,oDAAuD;AACvD,0DAA+D;AAC/D,oDAAuD;AACvD,qCAA8E;AAsB9E,MAAM,KAAK,GAAG,IAAI,oCAAwB,EAAE,CAAC;AAQ7C,MAAM,SAAS,GAA+B,EAAE,CAAC;AAEjD,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,QAAQ,KAAK,CAAC,CAAC;QACjB,OAAO,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,IAAI,OAAO,KAAK,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,KAAe,EAAU,EAAE;IACnE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KA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C;AAC7B,CAAC,CAAC;AAEF,kBAAe,sBAAsB,CAAC"}
|
package/lib/with-linaria.d.ts
CHANGED
|
@@ -1,253 +1,3 @@
|
|
|
1
1
|
import type { WithLinariaConfig } from './types';
|
|
2
2
|
export type LinariaConfig = WithLinariaConfig;
|
|
3
|
-
export default function withLinaria(config: WithLinariaConfig):
|
|
4
|
-
allowedDevOrigins?: string[];
|
|
5
|
-
exportPathMap?: (defaultMap: import("next/dist/server/config-shared").ExportPathMap, ctx: {
|
|
6
|
-
dev: boolean;
|
|
7
|
-
dir: string;
|
|
8
|
-
outDir: string | null;
|
|
9
|
-
distDir: string;
|
|
10
|
-
buildId: string;
|
|
11
|
-
}) => Promise<import("next/dist/server/config-shared").ExportPathMap> | import("next/dist/server/config-shared").ExportPathMap;
|
|
12
|
-
i18n?: import("next/dist/server/config-shared").I18NConfig | null;
|
|
13
|
-
typescript?: import("next/dist/server/config-shared").TypeScriptConfig;
|
|
14
|
-
typedRoutes?: boolean;
|
|
15
|
-
headers?: () => Promise<import("next/dist/lib/load-custom-routes").Header[]> | import("next/dist/lib/load-custom-routes").Header[];
|
|
16
|
-
rewrites?: () => Promise<import("next/dist/lib/load-custom-routes").Rewrite[] | {
|
|
17
|
-
beforeFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
18
|
-
afterFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
19
|
-
fallback?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
20
|
-
}> | import("next/dist/lib/load-custom-routes").Rewrite[] | {
|
|
21
|
-
beforeFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
22
|
-
afterFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
23
|
-
fallback?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
24
|
-
};
|
|
25
|
-
redirects?: () => Promise<import("next/dist/lib/load-custom-routes").Redirect[]> | import("next/dist/lib/load-custom-routes").Redirect[];
|
|
26
|
-
excludeDefaultMomentLocales?: boolean;
|
|
27
|
-
webpack?: import("next/dist/server/config-shared").NextJsWebpackConfig | null;
|
|
28
|
-
trailingSlash?: boolean;
|
|
29
|
-
env?: Record<string, string | undefined>;
|
|
30
|
-
distDir?: string;
|
|
31
|
-
cleanDistDir?: boolean;
|
|
32
|
-
assetPrefix?: string;
|
|
33
|
-
cacheHandler?: string | undefined;
|
|
34
|
-
cacheHandlers?: {
|
|
35
|
-
default?: string;
|
|
36
|
-
remote?: string;
|
|
37
|
-
static?: string;
|
|
38
|
-
[handlerName: string]: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
cacheMaxMemorySize?: number;
|
|
41
|
-
useFileSystemPublicRoutes?: boolean;
|
|
42
|
-
generateBuildId?: () => string | null | Promise<string | null>;
|
|
43
|
-
generateEtags?: boolean;
|
|
44
|
-
pageExtensions?: string[];
|
|
45
|
-
compress?: boolean;
|
|
46
|
-
poweredByHeader?: boolean;
|
|
47
|
-
images?: import("next/dist/shared/lib/image-config").ImageConfig;
|
|
48
|
-
devIndicators?: false | {
|
|
49
|
-
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
50
|
-
};
|
|
51
|
-
onDemandEntries?: {
|
|
52
|
-
maxInactiveAge?: number;
|
|
53
|
-
pagesBufferLength?: number;
|
|
54
|
-
};
|
|
55
|
-
deploymentId?: string;
|
|
56
|
-
basePath?: string;
|
|
57
|
-
sassOptions?: {
|
|
58
|
-
implementation?: string;
|
|
59
|
-
[key: string]: any;
|
|
60
|
-
};
|
|
61
|
-
productionBrowserSourceMaps?: boolean;
|
|
62
|
-
reactCompiler?: boolean | import("next/dist/server/config-shared").ReactCompilerOptions;
|
|
63
|
-
reactProductionProfiling?: boolean;
|
|
64
|
-
reactStrictMode?: boolean | null;
|
|
65
|
-
reactMaxHeadersLength?: number;
|
|
66
|
-
httpAgentOptions?: {
|
|
67
|
-
keepAlive?: boolean;
|
|
68
|
-
};
|
|
69
|
-
staticPageGenerationTimeout?: number;
|
|
70
|
-
crossOrigin?: "anonymous" | "use-credentials";
|
|
71
|
-
compiler?: {
|
|
72
|
-
reactRemoveProperties?: boolean | {
|
|
73
|
-
properties?: string[];
|
|
74
|
-
};
|
|
75
|
-
relay?: {
|
|
76
|
-
src: string;
|
|
77
|
-
artifactDirectory?: string;
|
|
78
|
-
language?: "typescript" | "javascript" | "flow";
|
|
79
|
-
eagerEsModules?: boolean;
|
|
80
|
-
};
|
|
81
|
-
removeConsole?: boolean | {
|
|
82
|
-
exclude?: string[];
|
|
83
|
-
};
|
|
84
|
-
styledComponents?: boolean | import("next/dist/server/config-shared").StyledComponentsConfig;
|
|
85
|
-
emotion?: boolean | import("next/dist/server/config-shared").EmotionConfig;
|
|
86
|
-
styledJsx?: boolean | {
|
|
87
|
-
useLightningcss?: boolean;
|
|
88
|
-
};
|
|
89
|
-
define?: Record<string, string>;
|
|
90
|
-
defineServer?: Record<string, string>;
|
|
91
|
-
runAfterProductionCompile?: (metadata: {
|
|
92
|
-
projectDir: string;
|
|
93
|
-
distDir: string;
|
|
94
|
-
}) => Promise<void>;
|
|
95
|
-
};
|
|
96
|
-
output?: "standalone" | "export";
|
|
97
|
-
transpilePackages?: string[];
|
|
98
|
-
turbopack?: import("next/dist/server/config-shared").TurbopackOptions;
|
|
99
|
-
skipMiddlewareUrlNormalize?: boolean;
|
|
100
|
-
skipProxyUrlNormalize?: boolean;
|
|
101
|
-
skipTrailingSlashRedirect?: boolean;
|
|
102
|
-
modularizeImports?: Record<string, {
|
|
103
|
-
transform: string | Record<string, string>;
|
|
104
|
-
preventFullImport?: boolean;
|
|
105
|
-
skipDefaultConversion?: boolean;
|
|
106
|
-
}>;
|
|
107
|
-
logging?: import("next/dist/server/config-shared").LoggingConfig | false;
|
|
108
|
-
enablePrerenderSourceMaps?: boolean;
|
|
109
|
-
cacheComponents?: boolean;
|
|
110
|
-
cacheLife?: {
|
|
111
|
-
[profile: string]: {
|
|
112
|
-
stale?: number;
|
|
113
|
-
revalidate?: number;
|
|
114
|
-
expire?: number;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
expireTime?: number;
|
|
118
|
-
experimental?: import("next/dist/server/config-shared").ExperimentalConfig;
|
|
119
|
-
bundlePagesRouterDependencies?: boolean;
|
|
120
|
-
serverExternalPackages?: string[];
|
|
121
|
-
outputFileTracingRoot?: string;
|
|
122
|
-
outputFileTracingExcludes?: Record<string, string[]>;
|
|
123
|
-
outputFileTracingIncludes?: Record<string, string[]>;
|
|
124
|
-
watchOptions?: {
|
|
125
|
-
pollIntervalMs?: number;
|
|
126
|
-
};
|
|
127
|
-
htmlLimitedBots?: RegExp;
|
|
128
|
-
} | {
|
|
129
|
-
webpack: (config: import("webpack").Configuration, options: import("next/dist/server/config-shared").WebpackConfigContext) => any;
|
|
130
|
-
allowedDevOrigins?: string[];
|
|
131
|
-
exportPathMap?: (defaultMap: import("next/dist/server/config-shared").ExportPathMap, ctx: {
|
|
132
|
-
dev: boolean;
|
|
133
|
-
dir: string;
|
|
134
|
-
outDir: string | null;
|
|
135
|
-
distDir: string;
|
|
136
|
-
buildId: string;
|
|
137
|
-
}) => Promise<import("next/dist/server/config-shared").ExportPathMap> | import("next/dist/server/config-shared").ExportPathMap;
|
|
138
|
-
i18n?: import("next/dist/server/config-shared").I18NConfig | null;
|
|
139
|
-
typescript?: import("next/dist/server/config-shared").TypeScriptConfig;
|
|
140
|
-
typedRoutes?: boolean;
|
|
141
|
-
headers?: () => Promise<import("next/dist/lib/load-custom-routes").Header[]> | import("next/dist/lib/load-custom-routes").Header[];
|
|
142
|
-
rewrites?: () => Promise<import("next/dist/lib/load-custom-routes").Rewrite[] | {
|
|
143
|
-
beforeFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
144
|
-
afterFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
145
|
-
fallback?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
146
|
-
}> | import("next/dist/lib/load-custom-routes").Rewrite[] | {
|
|
147
|
-
beforeFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
148
|
-
afterFiles?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
149
|
-
fallback?: import("next/dist/lib/load-custom-routes").Rewrite[];
|
|
150
|
-
};
|
|
151
|
-
redirects?: () => Promise<import("next/dist/lib/load-custom-routes").Redirect[]> | import("next/dist/lib/load-custom-routes").Redirect[];
|
|
152
|
-
excludeDefaultMomentLocales?: boolean;
|
|
153
|
-
trailingSlash?: boolean;
|
|
154
|
-
env?: Record<string, string | undefined>;
|
|
155
|
-
distDir?: string;
|
|
156
|
-
cleanDistDir?: boolean;
|
|
157
|
-
assetPrefix?: string;
|
|
158
|
-
cacheHandler?: string | undefined;
|
|
159
|
-
cacheHandlers?: {
|
|
160
|
-
default?: string;
|
|
161
|
-
remote?: string;
|
|
162
|
-
static?: string;
|
|
163
|
-
[handlerName: string]: string | undefined;
|
|
164
|
-
};
|
|
165
|
-
cacheMaxMemorySize?: number;
|
|
166
|
-
useFileSystemPublicRoutes?: boolean;
|
|
167
|
-
generateBuildId?: () => string | null | Promise<string | null>;
|
|
168
|
-
generateEtags?: boolean;
|
|
169
|
-
pageExtensions?: string[];
|
|
170
|
-
compress?: boolean;
|
|
171
|
-
poweredByHeader?: boolean;
|
|
172
|
-
images?: import("next/dist/shared/lib/image-config").ImageConfig;
|
|
173
|
-
devIndicators?: false | {
|
|
174
|
-
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
175
|
-
};
|
|
176
|
-
onDemandEntries?: {
|
|
177
|
-
maxInactiveAge?: number;
|
|
178
|
-
pagesBufferLength?: number;
|
|
179
|
-
};
|
|
180
|
-
deploymentId?: string;
|
|
181
|
-
basePath?: string;
|
|
182
|
-
sassOptions?: {
|
|
183
|
-
implementation?: string;
|
|
184
|
-
[key: string]: any;
|
|
185
|
-
};
|
|
186
|
-
productionBrowserSourceMaps?: boolean;
|
|
187
|
-
reactCompiler?: boolean | import("next/dist/server/config-shared").ReactCompilerOptions;
|
|
188
|
-
reactProductionProfiling?: boolean;
|
|
189
|
-
reactStrictMode?: boolean | null;
|
|
190
|
-
reactMaxHeadersLength?: number;
|
|
191
|
-
httpAgentOptions?: {
|
|
192
|
-
keepAlive?: boolean;
|
|
193
|
-
};
|
|
194
|
-
staticPageGenerationTimeout?: number;
|
|
195
|
-
crossOrigin?: "anonymous" | "use-credentials";
|
|
196
|
-
compiler?: {
|
|
197
|
-
reactRemoveProperties?: boolean | {
|
|
198
|
-
properties?: string[];
|
|
199
|
-
};
|
|
200
|
-
relay?: {
|
|
201
|
-
src: string;
|
|
202
|
-
artifactDirectory?: string;
|
|
203
|
-
language?: "typescript" | "javascript" | "flow";
|
|
204
|
-
eagerEsModules?: boolean;
|
|
205
|
-
};
|
|
206
|
-
removeConsole?: boolean | {
|
|
207
|
-
exclude?: string[];
|
|
208
|
-
};
|
|
209
|
-
styledComponents?: boolean | import("next/dist/server/config-shared").StyledComponentsConfig;
|
|
210
|
-
emotion?: boolean | import("next/dist/server/config-shared").EmotionConfig;
|
|
211
|
-
styledJsx?: boolean | {
|
|
212
|
-
useLightningcss?: boolean;
|
|
213
|
-
};
|
|
214
|
-
define?: Record<string, string>;
|
|
215
|
-
defineServer?: Record<string, string>;
|
|
216
|
-
runAfterProductionCompile?: (metadata: {
|
|
217
|
-
projectDir: string;
|
|
218
|
-
distDir: string;
|
|
219
|
-
}) => Promise<void>;
|
|
220
|
-
};
|
|
221
|
-
output?: "standalone" | "export";
|
|
222
|
-
transpilePackages?: string[];
|
|
223
|
-
turbopack?: import("next/dist/server/config-shared").TurbopackOptions;
|
|
224
|
-
skipMiddlewareUrlNormalize?: boolean;
|
|
225
|
-
skipProxyUrlNormalize?: boolean;
|
|
226
|
-
skipTrailingSlashRedirect?: boolean;
|
|
227
|
-
modularizeImports?: Record<string, {
|
|
228
|
-
transform: string | Record<string, string>;
|
|
229
|
-
preventFullImport?: boolean;
|
|
230
|
-
skipDefaultConversion?: boolean;
|
|
231
|
-
}>;
|
|
232
|
-
logging?: import("next/dist/server/config-shared").LoggingConfig | false;
|
|
233
|
-
enablePrerenderSourceMaps?: boolean;
|
|
234
|
-
cacheComponents?: boolean;
|
|
235
|
-
cacheLife?: {
|
|
236
|
-
[profile: string]: {
|
|
237
|
-
stale?: number;
|
|
238
|
-
revalidate?: number;
|
|
239
|
-
expire?: number;
|
|
240
|
-
};
|
|
241
|
-
};
|
|
242
|
-
expireTime?: number;
|
|
243
|
-
experimental?: import("next/dist/server/config-shared").ExperimentalConfig;
|
|
244
|
-
bundlePagesRouterDependencies?: boolean;
|
|
245
|
-
serverExternalPackages?: string[];
|
|
246
|
-
outputFileTracingRoot?: string;
|
|
247
|
-
outputFileTracingExcludes?: Record<string, string[]>;
|
|
248
|
-
outputFileTracingIncludes?: Record<string, string[]>;
|
|
249
|
-
watchOptions?: {
|
|
250
|
-
pollIntervalMs?: number;
|
|
251
|
-
};
|
|
252
|
-
htmlLimitedBots?: RegExp;
|
|
253
|
-
};
|
|
3
|
+
export default function withLinaria(config: WithLinariaConfig): WithLinariaConfig;
|
package/lib/with-linaria.js
CHANGED
|
@@ -4,13 +4,10 @@ exports.default = withLinaria;
|
|
|
4
4
|
const add_turbopack_config_1 = require("./add-turbopack-config");
|
|
5
5
|
const add_webpack_config_1 = require("./add-webpack-config");
|
|
6
6
|
function withLinaria(config) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
else {
|
|
12
|
-
return (0, add_webpack_config_1.addWebpackConfig)(config);
|
|
13
|
-
}
|
|
7
|
+
let configWithLinaria = config;
|
|
8
|
+
configWithLinaria = (0, add_turbopack_config_1.addTurbopackConfig)(configWithLinaria);
|
|
9
|
+
configWithLinaria = (0, add_webpack_config_1.addWebpackConfig)(configWithLinaria);
|
|
10
|
+
return configWithLinaria;
|
|
14
11
|
}
|
|
15
12
|
module.exports = withLinaria;
|
|
16
13
|
//# sourceMappingURL=with-linaria.js.map
|
package/lib/with-linaria.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-linaria.js","sourceRoot":"","sources":["../src/with-linaria.ts"],"names":[],"mappings":";;AAMA,8BAOC;AAbD,iEAA4D;AAC5D,6DAAwD;AAKxD,SAAwB,WAAW,CAAC,MAAyB;IAC3D,
|
|
1
|
+
{"version":3,"file":"with-linaria.js","sourceRoot":"","sources":["../src/with-linaria.ts"],"names":[],"mappings":";;AAMA,8BAOC;AAbD,iEAA4D;AAC5D,6DAAwD;AAKxD,SAAwB,WAAW,CAAC,MAAyB;IAC3D,IAAI,iBAAiB,GAAG,MAAM,CAAC;IAE/B,iBAAiB,GAAG,IAAA,yCAAkB,EAAC,iBAAiB,CAAC,CAAC;IAC1D,iBAAiB,GAAG,IAAA,qCAAgB,EAAC,iBAAiB,CAAC,CAAC;IAExD,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-with-linaria",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Linaria support for Next.js App Router",
|
|
5
5
|
"main": "lib/with-linaria.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
8
|
"watch": "tsc -w",
|
|
9
9
|
"clean": "rm -rf lib",
|
|
10
|
-
"lint": "
|
|
11
|
-
"
|
|
10
|
+
"lint": "oxlint",
|
|
11
|
+
"lint:fix": "oxlint --fix",
|
|
12
|
+
"fmt": "oxfmt",
|
|
13
|
+
"fmt:check": "oxfmt --check",
|
|
14
|
+
"test": "pnpm --filter ./tests/example run test",
|
|
12
15
|
"prepublish": "pnpm run clean && pnpm run build"
|
|
13
16
|
},
|
|
14
|
-
"packageManager": "pnpm@
|
|
17
|
+
"packageManager": "pnpm@10.33.0",
|
|
15
18
|
"devDependencies": {
|
|
16
|
-
"@rspack/core": "1.
|
|
19
|
+
"@rspack/core": "1.7.11",
|
|
17
20
|
"@types/fs-extra": "11.0.4",
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"
|
|
21
|
-
"@wyw-in-js/transform": "0.7.0",
|
|
22
|
-
"eslint": "9.35.0",
|
|
23
|
-
"eslint-config-prettier": "10.1.8",
|
|
24
|
-
"eslint-plugin-prettier": "5.5.4",
|
|
25
|
-
"eslint-plugin-simple-import-sort": "12.1.1",
|
|
26
|
-
"eslint-plugin-typescript-sort-keys": "3.3.0",
|
|
27
|
-
"eslint-plugin-unused-imports": "4.2.0",
|
|
28
|
-
"globals": "16.4.0",
|
|
21
|
+
"@wyw-in-js/babel-preset": "1.0.7",
|
|
22
|
+
"@wyw-in-js/transform": "1.0.7",
|
|
23
|
+
"globals": "17.4.0",
|
|
29
24
|
"is-ci": "4.1.0",
|
|
30
|
-
"lint-staged": "16.
|
|
31
|
-
"next": "16.
|
|
32
|
-
"
|
|
25
|
+
"lint-staged": "16.4.0",
|
|
26
|
+
"next": "16.2.2",
|
|
27
|
+
"oxfmt": "0.44.0",
|
|
28
|
+
"oxlint": "1.59.0",
|
|
33
29
|
"simple-git-hooks": "2.13.1",
|
|
34
|
-
"typescript": "
|
|
35
|
-
"webpack": "5.
|
|
30
|
+
"typescript": "6.0.2",
|
|
31
|
+
"webpack": "5.105.4"
|
|
36
32
|
},
|
|
37
33
|
"peerDependencies": {
|
|
38
34
|
"@babel/runtime": "7.x",
|
|
39
|
-
"@wyw-in-js/babel-preset": "
|
|
40
|
-
"@wyw-in-js/transform": "
|
|
35
|
+
"@wyw-in-js/babel-preset": "1.x",
|
|
36
|
+
"@wyw-in-js/transform": "1.x"
|
|
41
37
|
},
|
|
42
38
|
"files": [
|
|
43
39
|
"lib"
|
|
@@ -47,10 +43,10 @@
|
|
|
47
43
|
},
|
|
48
44
|
"lint-staged": {
|
|
49
45
|
"**/*.(js|jsx|ts|tsx)": [
|
|
50
|
-
"
|
|
46
|
+
"oxlint --fix"
|
|
51
47
|
],
|
|
52
48
|
"**/*.(js|jsx|ts|tsx|json|css|md|mdx)": [
|
|
53
|
-
"
|
|
49
|
+
"oxfmt"
|
|
54
50
|
]
|
|
55
51
|
},
|
|
56
52
|
"author": "Dario Lehmhus",
|