我正在将所有文件构建到一个名为“dist”的文件夹中。
我已经尝试添加 。
在devServer下,但是没有成功。我知道你可以在output下添加publicPath,但我不需要在虚拟目录中提供文件。我只想让它像IIS虚拟目录一样运行。
我的最终目标是从dist文件夹中的http://localhost:9004/virtual-directory-name-here提供所有文件。
有人能指点我吗?
Dist
->index.html
->bundle.js
我的配置已经设置为使用我需要的特定端口运行。
{
entry: './src/index.js',
devtool: 'source-map',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
devServer: {
port: 9004,
contentBase: path.join(__dirname, "dist")
},
watch: true,
}
我已经尝试添加 。
proxy: {
"/virtual-directory-name-here": {
"target": {
"host": "localhost",
"port": 9004
}
}
}
在devServer下,但是没有成功。我知道你可以在output下添加publicPath,但我不需要在虚拟目录中提供文件。我只想让它像IIS虚拟目录一样运行。
我的最终目标是从dist文件夹中的http://localhost:9004/virtual-directory-name-here提供所有文件。
有人能指点我吗?