vike 0.4.200-commit-a317fa3 → 0.4.200-commit-b635c6a
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/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +14 -4
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +14 -4
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -100,7 +100,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
100
100
|
setup(build) {
|
|
101
101
|
// https://github.com/brillout/esbuild-playground
|
|
102
102
|
build.onResolve({ filter: /.*/ }, async (args) => {
|
|
103
|
-
console.log('onResolve()', args);
|
|
103
|
+
console.log('onResolve()', JSON.stringify(args, null, 2));
|
|
104
104
|
if (args.kind !== 'import-statement')
|
|
105
105
|
return;
|
|
106
106
|
// Avoid infinite loop: https://github.com/evanw/esbuild/issues/3095#issuecomment-1546916366
|
|
@@ -109,15 +109,25 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
109
109
|
return;
|
|
110
110
|
const { path, ...opts } = args;
|
|
111
111
|
opts.pluginData = { [useEsbuildResolver]: true };
|
|
112
|
-
|
|
113
|
-
console.log('resolved',
|
|
112
|
+
let resolved = await build.resolve(path, opts);
|
|
113
|
+
console.log('resolved', JSON.stringify(args, null, 2));
|
|
114
114
|
if (resolved.errors.length > 0) {
|
|
115
|
+
let resolvedWithNode;
|
|
116
|
+
try {
|
|
117
|
+
resolvedWithNode = require.resolve(args.path, { paths: [args.resolveDir] });
|
|
118
|
+
}
|
|
119
|
+
catch { }
|
|
120
|
+
console.log('resolvedWithNode', resolvedWithNode);
|
|
121
|
+
if (resolvedWithNode)
|
|
122
|
+
resolved = { path: resolvedWithNode };
|
|
123
|
+
}
|
|
124
|
+
if (resolved.errors && resolved.errors.length > 0) {
|
|
115
125
|
/* We could do the following to let Node.js throw the error, but we don't because the error shown by esbuild is prettier: the Node.js error refers to the transpiled [build-f7i251e0iwnw]+config.ts.mjs whereas esbuild refers to the source +config.ts file.
|
|
116
126
|
pointerImports[args.path] = false
|
|
117
127
|
return { external: true }
|
|
118
128
|
*/
|
|
119
|
-
cleanEsbuildErrors(resolved.errors);
|
|
120
129
|
// Let esbuild throw the error
|
|
130
|
+
cleanEsbuildErrors(resolved.errors);
|
|
121
131
|
return resolved;
|
|
122
132
|
}
|
|
123
133
|
(0, utils_js_1.assert)(resolved.path);
|
|
@@ -95,7 +95,7 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
95
95
|
setup(build) {
|
|
96
96
|
// https://github.com/brillout/esbuild-playground
|
|
97
97
|
build.onResolve({ filter: /.*/ }, async (args) => {
|
|
98
|
-
console.log('onResolve()', args);
|
|
98
|
+
console.log('onResolve()', JSON.stringify(args, null, 2));
|
|
99
99
|
if (args.kind !== 'import-statement')
|
|
100
100
|
return;
|
|
101
101
|
// Avoid infinite loop: https://github.com/evanw/esbuild/issues/3095#issuecomment-1546916366
|
|
@@ -104,15 +104,25 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
|
|
|
104
104
|
return;
|
|
105
105
|
const { path, ...opts } = args;
|
|
106
106
|
opts.pluginData = { [useEsbuildResolver]: true };
|
|
107
|
-
|
|
108
|
-
console.log('resolved',
|
|
107
|
+
let resolved = await build.resolve(path, opts);
|
|
108
|
+
console.log('resolved', JSON.stringify(args, null, 2));
|
|
109
109
|
if (resolved.errors.length > 0) {
|
|
110
|
+
let resolvedWithNode;
|
|
111
|
+
try {
|
|
112
|
+
resolvedWithNode = require.resolve(args.path, { paths: [args.resolveDir] });
|
|
113
|
+
}
|
|
114
|
+
catch { }
|
|
115
|
+
console.log('resolvedWithNode', resolvedWithNode);
|
|
116
|
+
if (resolvedWithNode)
|
|
117
|
+
resolved = { path: resolvedWithNode };
|
|
118
|
+
}
|
|
119
|
+
if (resolved.errors && resolved.errors.length > 0) {
|
|
110
120
|
/* We could do the following to let Node.js throw the error, but we don't because the error shown by esbuild is prettier: the Node.js error refers to the transpiled [build-f7i251e0iwnw]+config.ts.mjs whereas esbuild refers to the source +config.ts file.
|
|
111
121
|
pointerImports[args.path] = false
|
|
112
122
|
return { external: true }
|
|
113
123
|
*/
|
|
114
|
-
cleanEsbuildErrors(resolved.errors);
|
|
115
124
|
// Let esbuild throw the error
|
|
125
|
+
cleanEsbuildErrors(resolved.errors);
|
|
116
126
|
return resolved;
|
|
117
127
|
}
|
|
118
128
|
assert(resolved.path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.200-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.200-commit-b635c6a";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.200-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.200-commit-b635c6a';
|