Skip to content

Commit

Permalink
Detect when running inside wsl
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinovantes committed Aug 7, 2022
1 parent ef529eb commit b4d2eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import packageJson from './package.json'

const isDev = (process.env.NODE_ENV === 'development')
const srcDir = path.resolve(__dirname, 'src')
const baseUrl = url.pathToFileURL(path.resolve(__dirname, 'dist')).href
const distDir = path.resolve(__dirname, 'dist')
const baseUrl = process.env.WSL_DISTRO_NAME
? url.pathToFileURL(distDir).href.replace('file://', `file:////wsl.localhost/${process.env.WSL_DISTRO_NAME}`)
: url.pathToFileURL(distDir).href

if (isDev) {
let msg = ''
Expand Down

0 comments on commit b4d2eec

Please sign in to comment.