add support for node 6
[issue link]In some environments, it’s difficult/impossible to upgrade node versions (in my case, AWS Lambda).
Note that while Node 4.x is end-of-lifing next month that Node 6.x is still supported, and should be supported by packages. see https://github.com/nodejs/Release/blob/master/README.md
I see that other’s ran into this issue before:
https://github.com/nuxt/nuxt.js/issues/2395
https://github.com/nuxt/nuxt.js/issues/2927
and that code was even added to check for this:
https://github.com/nuxt/nuxt.js/pull/2718
In my case, I made a new re-package of nuxt which does some transpilation:
https://github.com/phlogisticfugu/nuxtjs-node6
I’d propose:
- a new ./node6/index.js bundle, made via rollup, during npm prepare, which transpiles, with babel shims/runtime-module a version of the nuxt library that runs on node6
- then in node6 environments, one can use: const { Nuxt } = require(‘nuxt/node6’)
- a node6.rollup.config.js to configure that build, and addition of rollup and appropriate plugins to devDependencies
- a decrease in the required package.json version
- transpiled bin scripts: bin/nuxt-node6 built to permit executing CLI commands in a node6 environment.