Results 1 to 7 of 7

Thread: "npm run build" modifies index.html

  1. #1

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default "npm run build" modifies index.html

    Is it expected that running "npm run build" modifies the original index.html in the top-level directory of the project to insert the main.js script? Further, is it expected that running that command again inserts that tag again? I didn't expect the build process to modify the source files.

    ExtJS 7.0.0-CE

  2. #2

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default

    It's also adding <base href="/"> to the original index.html which is passed through on subsequent builds to the built index.html preventing it from loading via file:///... This seems like a mistake.

  3. #3

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default

    Circled back to this over the weekend. I've modified the webpack config as show below so that it generates the index page from a separate template instead of modifying it in place. I commit the template and tell git to ignore the generated page. Much cleaner.

    Code:
        const plugins = [
          new HtmlWebpackPlugin({ 
            template: "index.html.tmpl",
            filename: "index.html",
            hash: true,
            inject: "body"
          }),
    ...

  4. #4

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default

    The change above works in dev but when I "npm run build" the generated build/production/App/index.html is empty.

  5. #5

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default

    So, nobody from Sencha is watching these forums now, right?

  6. #6
    Sencha Premium Member
    Join Date
    Mar 2016
    Location
    Italy
    Posts
    44

    Default

    I think no, so frustating

  7. #7

    Join Date
    Nov 2010
    Location
    Canton, GA, USA
    Posts
    182

    Default

    I ended up asking support about this a while back. Forgot to circle back here. Basically, there were a few updates to the open-tools scheme with the 7.1 release that address this and a number of other issues. I no longer have lines in my build system to revert errant changes to the index.html.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •