Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use .mjs extension for injected client modules #4061

Merged
merged 1 commit into from Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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