Skip to content

Trying to use webpacker (3) for a API/JS client #1016

@alain-andre

Description

@alain-andre

I'm trying to create a rails api and a separated JS client using webpacker.

When launching my app, the public/packs/manifest.json contains this :

{
  "application.js": "/packs/application-d2ce57fea2210882a7d4.js",
  "hello_vue.css": "/packs/hello_vue-9cb5a7334a6577c3422968b9b9970b2f.css",
  "hello_vue.js": "/packs/hello_vue-d8d50a7562d6abcbea06.js"
}

And I whant to use it in my public/index.html file as it :

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="packs/hello_vue.css" />
  </head>

  <body>
    <script type="text/javascript" src="packs/application.js"></script>
    <script type="text/javascript" src="packs/hello_vue.js"></script>
  </body>
</html>

Is there a way to configure webpacker not to generate file with the random number ? Or a better way to make the index.html launch the good generated files ? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions