简体   繁体   English

VertX Web服务器静态内容webroot

[英]VertX Webserver static content webroot

I've got two projects which I've created: 我已经创建了两个项目:

  1. A web UI built using webpack 使用webpack构建的Web UI
  2. A Vert.x webserver written in java built using Gradle 使用Gradle构建的用java编写的Vert.x Web服务器

I want to find a way to bring the resulting build dir contents of the first project into the second as the webroot which will be server up using the StaticHandler . 我想找到一种方法,将第一个项目的生成的dir目录作为webroot引入第二个项目,该webroot将使用StaticHandler在服务器上StaticHandler

Is anyone aware of a clean way to do this? 有人知道这样做的干净方法吗? I want to preserve the two git projects as they are because I like using the webpack dev server for development of the UI and it generally feels cleaner to have them separated. 我想按原样保留这两个git项目,因为我喜欢使用webpack dev server来开发UI,通常感觉很干净,将它们分开。

I was looking at potentially using the bitbucket pipelines build on my repo, however bringing the assets generated by the first project into the build of the second is where I'm facing issues. 我当时正在考虑潜在地在我的仓库中使用bitbucket管道,但是将第一个项目生成的资产带入第二个项目的构建是我面临的问题。

You could create a gradle task that before that depends on the jar task (so it runs before it) executes webpack compile into the resources directory. 您可以创建一个gradle任务,该任务在此之前取决于jar任务(因此它在它之前运行)将webpack编译到resources目录中。 So when your jar task runs it bundles the compiled webpack code. 因此,当您的jar任务运行时,它将捆绑已编译的Webpack代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM