Toggle mjs files to javascript/auto type (#5151)

This commit is contained in:
Joe Haddad
2018-09-28 08:34:06 -04:00
committed by GitHub
parent 2a7346e085
commit 3ae3cf3678
7 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
const {
bootstrap,
isSuccessfulDevelopment,
isSuccessfulProduction,
} = require('../../utils');
beforeEach(async () => {
await bootstrap({ directory: global.testDirectory, template: __dirname });
});
describe('graphql with mjs entrypoint', () => {
it('builds in development', async () => {
await isSuccessfulDevelopment({ directory: global.testDirectory });
});
it('builds in production', async () => {
await isSuccessfulProduction({ directory: global.testDirectory });
});
});

View File

@@ -0,0 +1,10 @@
{
"dependencies": {
"apollo-boost": "0.1.16",
"graphql": "14.0.2",
"react-apollo": "2.2.1",
"react": "latest",
"react-dom": "latest",
"react-scripts": "latest"
}
}

View File

@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@@ -0,0 +1,20 @@
import React, { Component } from 'react';
import ApolloClient from 'apollo-boost';
import { ApolloProvider } from 'react-apollo';
const client = new ApolloClient({
uri: '/whatever',
});
class App extends Component {
render() {
return (
<ApolloProvider client={client}>
<div />
</ApolloProvider>
);
}
}
export default App;

View File

@@ -0,0 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));