Skip to content

Commit f35f768

Browse files
committed
fix(bundler-webpack): fix windows compatibility (close #12)
1 parent aa4ff82 commit f35f768

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/@vuepress/bundler-webpack/src/dev/createDevServerConfig.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sep } from 'path'
12
import type { WebpackOptionsNormalized } from 'webpack'
23
import * as WebpackDevServer from 'webpack-dev-server'
34
import { App } from '@vuepress/core'
@@ -37,7 +38,8 @@ export const createDevServerConfig = (
3738
overlay: false,
3839
port: app.options.port,
3940
static: {
40-
directory: app.dir.public(),
41+
// `static.directory` will fail on Windows if we do not replace / with \
42+
directory: app.dir.public().replace('/', sep),
4143
publicPath: app.options.base,
4244
watch: {
4345
ignoreInitial: true,

0 commit comments

Comments
 (0)