webpack之output output 配置项中有一个字段:publicPath。 // webpack.config.js module.exports = { output: { publicPath: 'https://localhost:8080' } } // html文件(没有编译前的html文件) <script src="styles/index.css" ></script> // html文件(编译后的html文件) <script src="https://localhost:8080/styles/index.css" ></script>