Skip to content

overriding publicPath (or, how to set the path for scripts when app is not at server root)? #393

@tconroy

Description

@tconroy

I have a base, dev and dist webpack config. dev and dist extend base with some custom setup for developing locally vs. deploying to our server. When I run dist it bundles all my code into a folder with the following structure:

dist/
    assets/
        app.js
        vendors.js
    index.html
    favicon.ico

the scripts in index.html get the following structure:

<script type="text/javascript" src="/assets/vendors.js?4aaf64703d2dfe86cedc"></script>
  <script type="text/javascript" src="/assets/app.js?4aaf64703d2dfe86cedc"></script>

... which is fine when I am developing locally, as the project exists at the "root" of my local server, however the project lives in a deeply nested sub directory on my server -- /assets/ maps to the root /assets/ directory, when I really need it to be more like assets/vendors.js or even ./assets/vendors.js

Is there a way I can specify this for this plugin? I believe it would require overriding publicPath. Not sure if that's doable/possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions