Open kimamula opened 6 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
}
]
}
It works if you disable transformModulesToAmd
:
{
...
"builds": [
{
"preset": "es6-unbundled",
"js": {
"transformModulesToAmd": false
}
}
]
}
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.
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 implementingPushManifestPlugin
webpack plugin.