Skip to content

Commit

Permalink
Go
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 24, 2022
1 parent 6a3db84 commit d17a1f3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/sveltekit/__tests__/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let toSkip = false;

describe('SvelteKit integration', () => {
beforeAll(async () => {
console.time('Setup SvelteKit tests');
// console.time('Setup SvelteKit tests');

const nodeVersion = execSync('node -v').toString();
if (nodeVersion.includes('v12')) {
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('SvelteKit integration', () => {
}

// How long it took?
console.timeEnd('Setup SvelteKit tests');
// console.timeEnd('Setup SvelteKit tests');
}, timings.setup.total);

beforeEach(async () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/graphiql/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<script type="module">
import * as yogaGraphiQL from './src/bundle.tsx'
const container = window.document.querySelector('#root')
yogaGraphiQL.renderYogaGraphiQL(container)
yogaGraphiQL.renderYogaGraphiQL(container, {
endpoint: '/graphql',
})
</script>
</body>
</html>
7 changes: 6 additions & 1 deletion packages/graphiql/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default defineConfig({
'/graphql': 'http://localhost:4000',
},
},
define: {
'process.env.NODE_ENV': '"production"',
},
build: {
lib: {
entry: path.resolve(__dirname, 'src', 'bundle.tsx'),
Expand All @@ -19,7 +22,9 @@ export default defineConfig({
},
rollupOptions: {
output: {
inlineDynamicImports: true,
/** prevent code-splitting */
inlineDynamicImports: false,
manualChunks: () => '_.js',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/render-graphiql/scripts/yoga-bundle-string.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fileURLToPath } from 'url'

const directoryName = path.dirname(fileURLToPath(import.meta.url))
const inputPath = path.resolve(directoryName, '..', '..', 'graphiql', 'dist')
const jsFile = path.resolve(inputPath, 'yoga-graphiql.es.js')
const jsFile = path.resolve(inputPath, 'yoga-graphiql.umd.js')
const cssFile = path.resolve(inputPath, 'style.css')

const outFile = path.resolve(directoryName, '..', 'src', 'graphiql.ts')
Expand Down
4 changes: 2 additions & 2 deletions packages/render-graphiql/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const renderGraphiQL = (opts?: GraphiQLOptions) => /* HTML */ `
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module">
<script>
${js}
renderYogaGraphiQL(
YogaGraphiQL.renderYogaGraphiQL(
window.document.querySelector('#root'),
${JSON.stringify(opts ?? {})},
)
Expand Down

0 comments on commit d17a1f3

Please sign in to comment.