Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

Is `push-manifest.json` not generated automatically in Polymer 3.0? #523

Open kimamula opened 6 years ago

kimamula commented 6 years ago

Is it possible to generate push-manifest.json automatically in Polymer 3.0? If not, is there a plan to support it?

FYI, preact-cli supports automatic push-manifest.json generation by implementing PushManifestPlugin webpack plugin.

hellokatili commented 5 years ago

I followed the "Build for production" guide. But my push-manifest.json is almost empty:

{
  "src/my-app.js": {}
}

If a add some fragments in polymer.json, these files are listed in push-manifest.json:

{
  "src/myview-1.js": {},
  "src/myview-2.js": {},
  "src/listview.js": {}
}

But that's not what I expected...

The last paragraph in the section about the dynamic imports says:

You don't need to list dynamic imports as fragments. The latest Polymer build tools analyze your code and find your dynamic imports, provided they are expressed with static strings. There's no need to list them as separate fragments.

What am I doing wrong?

This is my polymer.json:

{
  "npm": true,
  "moduleResolution": "node",
  "lint": {
    "rules": [
      "polymer-3"
    ]
  },
  "entrypoint": "index.html",
  "shell": "src/my-app.js",
  "sources": [
    "src/my-app.js",
    "images/**/*"
  ],
  "fragments": [
    "src/myview-1.js"
    "src/myview-2.js"
    "src/listview.js"
  ],
  "extraDependencies": [
    "manifest.json",
    "browserconfig.xml",
    "node_modules/@webcomponents/webcomponentsjs/*.js",
    "!node_modules/@webcomponents/webcomponentsjs/gulpfile.js",
    "node_modules/@webcomponents/webcomponentsjs/bundles/*.js"
  ],
  "builds": [
    {
      "preset": "es6-unbundled",
      "basePath": true,
      "addServiceWorker": false
    }
  ]
}
hellokatili commented 5 years ago

It works if you disable transformModulesToAmd:

{
  ...
  "builds": [
    {
      "preset": "es6-unbundled",
      "js": {
        "transformModulesToAmd": false
      }
    }
  ]
}
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.