vike 0.4.169 → 0.4.170

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.
@@ -139,9 +139,10 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
139
139
  // - When tsconfig.js#compilerOptions.paths is set, then esbuild is able to resolve the path alias.
140
140
  resolved.errors.length > 0;
141
141
  (0, utils_js_1.assertPosixPath)(importPathResolved);
142
+ const isNodeModules = importPathResolved.includes('/node_modules/');
142
143
  const isExternal = isPointerImport ||
143
144
  // Performance: npm package imports that aren't pointer imports can be externalized. For example, if Vike eventually adds support for setting Vite configs in the vike.config.js file, then the user may import a Vite plugin in his vike.config.js file. (We could as well let esbuild always transpile /node_modules/ code but it would be useless and would unnecessarily slow down transpilation.)
144
- importPathResolved.includes('/node_modules/');
145
+ isNodeModules;
145
146
  const filePathAbsoluteUserRootDir = (0, getFilePath_js_1.getFilePathAbsoluteUserRootDir)({
146
147
  filePathAbsoluteFilesystem: importPathResolved,
147
148
  userRootDir
@@ -166,8 +167,8 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
166
167
  // importPathOriginal is either:
167
168
  // - Npm package import
168
169
  // - Path alias
169
- if (filePathAbsoluteUserRootDir) {
170
- // importPathOriginal is most likely a path alias. (Is it even possible for an npm package import to resolved inside `userRootDir`?)
170
+ if (filePathAbsoluteUserRootDir && !isNodeModules) {
171
+ // importPathOriginal is most likely (always?) a path alias.
171
172
  importPathTranspiled = importPathResolved;
172
173
  }
173
174
  else {
@@ -132,6 +132,7 @@ async function loadInterfaceFiles(userRootDir, outDirRoot, isDev) {
132
132
  'vike-pinia',
133
133
  'vike-solid'
134
134
  ];
135
+ (0, utils_js_1.assert)(extendsConfig.filePath.importPathAbsolute);
135
136
  const extensionName = extendsConfig.filePath.importPathAbsolute.split('/')[0];
136
137
  const warnMsg = alreadyMigrated.includes(extensionName)
137
138
  ? `You're using a deprecated version of the Vike extension ${extensionName}, update ${extensionName} to its latest version.`
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = exports.projectInfo = void 0;
4
- const PROJECT_VERSION = '0.4.169';
4
+ const PROJECT_VERSION = '0.4.170';
5
5
  exports.PROJECT_VERSION = PROJECT_VERSION;
6
6
  const projectInfo = {
7
7
  projectName: 'Vike',
@@ -136,9 +136,10 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
136
136
  // - When tsconfig.js#compilerOptions.paths is set, then esbuild is able to resolve the path alias.
137
137
  resolved.errors.length > 0;
138
138
  assertPosixPath(importPathResolved);
139
+ const isNodeModules = importPathResolved.includes('/node_modules/');
139
140
  const isExternal = isPointerImport ||
140
141
  // Performance: npm package imports that aren't pointer imports can be externalized. For example, if Vike eventually adds support for setting Vite configs in the vike.config.js file, then the user may import a Vite plugin in his vike.config.js file. (We could as well let esbuild always transpile /node_modules/ code but it would be useless and would unnecessarily slow down transpilation.)
141
- importPathResolved.includes('/node_modules/');
142
+ isNodeModules;
142
143
  const filePathAbsoluteUserRootDir = getFilePathAbsoluteUserRootDir({
143
144
  filePathAbsoluteFilesystem: importPathResolved,
144
145
  userRootDir
@@ -163,8 +164,8 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports) {
163
164
  // importPathOriginal is either:
164
165
  // - Npm package import
165
166
  // - Path alias
166
- if (filePathAbsoluteUserRootDir) {
167
- // importPathOriginal is most likely a path alias. (Is it even possible for an npm package import to resolved inside `userRootDir`?)
167
+ if (filePathAbsoluteUserRootDir && !isNodeModules) {
168
+ // importPathOriginal is most likely (always?) a path alias.
168
169
  importPathTranspiled = importPathResolved;
169
170
  }
170
171
  else {
@@ -127,6 +127,7 @@ async function loadInterfaceFiles(userRootDir, outDirRoot, isDev) {
127
127
  'vike-pinia',
128
128
  'vike-solid'
129
129
  ];
130
+ assert(extendsConfig.filePath.importPathAbsolute);
130
131
  const extensionName = extendsConfig.filePath.importPathAbsolute.split('/')[0];
131
132
  const warnMsg = alreadyMigrated.includes(extensionName)
132
133
  ? `You're using a deprecated version of the Vike extension ${extensionName}, update ${extensionName} to its latest version.`
@@ -1,7 +1,7 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- declare const PROJECT_VERSION: "0.4.169";
3
+ declare const PROJECT_VERSION: "0.4.170";
4
4
  declare const projectInfo: {
5
5
  projectName: "Vike";
6
- projectVersion: "0.4.169";
6
+ projectVersion: "0.4.170";
7
7
  };
@@ -1,6 +1,6 @@
1
1
  export { projectInfo };
2
2
  export { PROJECT_VERSION };
3
- const PROJECT_VERSION = '0.4.169';
3
+ const PROJECT_VERSION = '0.4.170';
4
4
  const projectInfo = {
5
5
  projectName: 'Vike',
6
6
  projectVersion: PROJECT_VERSION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.169",
3
+ "version": "0.4.170",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",