Skip to content

Commit

Permalink
fix: use .mjs extension for injected client modules (vitejs#4061)
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea authored and aleclarson committed Nov 8, 2021
1 parent e60cd99 commit f9fafe4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/vite/rollup.config.js
Expand Up @@ -26,7 +26,7 @@ const envConfig = {
})
],
output: {
dir: path.resolve(__dirname, 'dist/client'),
file: path.resolve(__dirname, 'dist/client', 'env.mjs'),
sourcemap: true
}
}
Expand All @@ -48,7 +48,7 @@ const clientConfig = {
})
],
output: {
dir: path.resolve(__dirname, 'dist/client'),
file: path.resolve(__dirname, 'dist/client', 'client.mjs'),
sourcemap: true
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/constants.ts
Expand Up @@ -41,9 +41,9 @@ export const NULL_BYTE_PLACEHOLDER = `__x00__`
export const CLIENT_PUBLIC_PATH = `/@vite/client`
export const ENV_PUBLIC_PATH = `/@vite/env`
// eslint-disable-next-line node/no-missing-require
export const CLIENT_ENTRY = require.resolve('vite/dist/client/client.js')
export const CLIENT_ENTRY = require.resolve('vite/dist/client/client.mjs')
// eslint-disable-next-line node/no-missing-require
export const ENV_ENTRY = require.resolve('vite/dist/client/env.js')
export const ENV_ENTRY = require.resolve('vite/dist/client/env.mjs')
export const CLIENT_DIR = path.dirname(CLIENT_ENTRY)

export const KNOWN_ASSET_TYPES = [
Expand Down

0 comments on commit f9fafe4

Please sign in to comment.