Skip to content

Instantly share code, notes, and snippets.

@kespinola
Created July 9, 2018 14:24
Show Gist options
  • Save kespinola/24b18b2bb9cf4cc65e6ae6bf4bf62932 to your computer and use it in GitHub Desktop.
Save kespinola/24b18b2bb9cf4cc65e6ae6bf4bf62932 to your computer and use it in GitHub Desktop.
relay starter neutrino config
const FlowWebpackPlugin = require("flow-webpack-plugin");
const PUBLIC_PATH = process.env.PUBLIC_PATH || "http://localhost:5000/";
module.exports = {
use: [
[
"neutrino-preset-react",
{
babel: {
plugins: [
"transform-flow-strip-types",
["relay", { schema: "./schema.graphql" }]
]
},
html: {
title: "Relay AWS Demo"
},
devServer: {
publicPath: PUBLIC_PATH,
historyApiFallback: {
rewrites: [{ from: /^\/$/, to: "/index.html" }]
}
}
}
],
["neutrino-middleware-env", ["GRAPHQL_URL"]],
({ config, options }) => {
config.output.publicPath(PUBLIC_PATH);
config.when(options.command === "start", config => {
config.devServer.headers({ "Access-Control-Allow-Origin": "*" });
});
config.plugin("flow").use(FlowWebpackPlugin, []);
}
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment