Mirror: The small sibling of the graphql package, slimmed down for client-side libraries.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Copy .d.ts and .js.flow typings to output

+36
+36
scripts/rollup/config.js
··· 1 1 import * as path from 'path'; 2 + import { promises as fs } from 'fs'; 2 3 3 4 import resolve from '@rollup/plugin-node-resolve'; 4 5 import { babel } from '@rollup/plugin-babel'; ··· 101 102 const aliasSource = path.join(aliasModule, graphqlEntry); 102 103 const alias = await this.resolve(aliasSource, undefined, { skipSelf: true }); 103 104 return alias || target; 105 + } 106 + 107 + return null; 108 + }, 109 + 110 + async renderChunk(_code, { fileName }) { 111 + const name = fileName.replace(/\.m?js$/, ''); 112 + 113 + const getContents = async (extension) => { 114 + try { 115 + const name = fileName.replace(/\.m?js$/, ''); 116 + const contents = await fs.readFile(path.join(graphqlModule, name + extension)); 117 + return contents; 118 + } catch (_error) { 119 + return null; 120 + } 121 + } 122 + 123 + const dts = await getContents('.d.ts'); 124 + const flow = await getContents('.js.flow'); 125 + 126 + if (dts) { 127 + this.emitFile({ 128 + type: 'asset', 129 + fileName: name + '.d.ts', 130 + source: dts, 131 + }); 132 + } 133 + 134 + if (flow) { 135 + this.emitFile({ 136 + type: 'asset', 137 + fileName: name + '.js.flow', 138 + source: flow, 139 + }); 104 140 } 105 141 106 142 return null;