Created
July 9, 2018 14:24
-
-
Save kespinola/24b18b2bb9cf4cc65e6ae6bf4bf62932 to your computer and use it in GitHub Desktop.
relay starter neutrino config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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