Closed logicalphase closed 5 years ago
Thanks for the report. Off the top, it looks like a node versions problem, as the offending line is
const { writeFile } = require('fs').promises;
The fs promises API was added in node 10. Try again with node 10+. If you need earlier support we can rewrite to use promisify (added in 8) or maybe a polyfill. PRs, naturally, are welcome. At the very least, the package.json should probably specify node 10+, but I know that some workflows are limited to older versions so a refactor might be the best thing.
If you like, we can do a pair programming session - catch me Sunday/Monday business hours EEST on Polymer Slack.
Ok v1.2.2 uses fs.promises
polyfill. please update and try again.
That should solve the immediate problem, but in truth the plugin should probably use rollup's emitAsset
instead of writeFile
.
Closed by ac9184d please reopen as needed.
Just in case someone comes looking, just wanted to update.
Updated from:
node 11.1.0
npm 6.9.0
plugin v1.2.2
That's got it working. Thanks for the help and the plugin(s), much appreciated.
Hi Benny - I've been using a couple of your rollup plugins to create a built process for the HyperPress project. HyperPress is based on @polymer - lit-element pwa-starter-kit. Rollup does a great of code-splitting and as you know, the downside of that is the initial visit lag while the chunks get pulled in and cached. So, followup visits exhibit great performance, whereas first visits suffer a full second increase in full load times. I thought this plugin would be a great solution for modulepreload of those chunks. But I've run into the following when running it:
The rollup.config.js:
I'm not sure what's causing it, but I may be missing the tree for the forest here too. I'm using gulp for some tasks such as moving root dist files, and testing against PRPL build. But nothing special there I think. Thanks for the assist.