You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Node 8.5's new es module import to run a SPA application in SSR mode in Node. In this case it's very useful to have the sourcecode for Node running without the need to transpile it. The implementation for Node dictates that the file extension for modules is '.mjs'. By renaming index.js to index.mjs, Node can easily import and use the file. Transpilers like rollup can handle different extensions without any problems, so it shouldn't be a problem for legacy builds.
Also, I'm not sure if that's due to my rollup settings, but when I do an import like: import {HttpAdapter as DSHttpAdapter} from 'js-data-http'
Rollup will include js-data twice(once from js-data-http and once from js-data-adapter). Wouldn't it be much easier to keep the bundle size small, by assuming a global like: const {utils} = JSData
Instead of import { utils } from 'js-data'
Using an external option for js-data in rollup seems a bit cumbersome when js-data is included in the same vendor.js file. I add a pull request just as demo(what works for me). Please let me know if I can help out. The same thing applies for js-data-adapter.
The text was updated successfully, but these errors were encountered:
I'm using Node 8.5's new es module import to run a SPA application in SSR mode in Node. In this case it's very useful to have the sourcecode for Node running without the need to transpile it. The implementation for Node dictates that the file extension for modules is '.mjs'. By renaming
index.js
toindex.mjs
, Node can easily import and use the file. Transpilers like rollup can handle different extensions without any problems, so it shouldn't be a problem for legacy builds.Also, I'm not sure if that's due to my rollup settings, but when I do an import like:
import {HttpAdapter as DSHttpAdapter} from 'js-data-http'
Rollup will include js-data twice(once from js-data-http and once from js-data-adapter). Wouldn't it be much easier to keep the bundle size small, by assuming a global like:
const {utils} = JSData
Instead of
import { utils } from 'js-data'
Using an external option for js-data in rollup seems a bit cumbersome when js-data is included in the same vendor.js file. I add a pull request just as demo(what works for me). Please let me know if I can help out. The same thing applies for
js-data-adapter
.The text was updated successfully, but these errors were encountered: