Skip to content

Instantly share code, notes, and snippets.

@jtulk
Created May 30, 2017 17:48
Show Gist options
  • Select an option

  • Save jtulk/a41d78a06374942b1eef1f8b4501086e to your computer and use it in GitHub Desktop.

Select an option

Save jtulk/a41d78a06374942b1eef1f8b4501086e to your computer and use it in GitHub Desktop.
Webpack Server Config
// stashing a webpack config for transforming ES6 Code for Node
const path = require("path");
const webpack = require("webpack");
const nodeExternals = require("webpack-node-externals");
module.exports = function(env) {
return {
entry: ["babel-polyfill", path.join(__dirname, "..", "server", "app.js")],
output: {
path: path.join(__dirname, ".."),
filename: `app.js`
},
module: {
rules: [
{
test: /\.jsx?$/,
include: [path.join(__dirname, "/../server")],
exclude: [
path.join(__dirname, "/../src"),
path.join(__dirname, "/../test"),
path.join(__dirname, "/../node_modules")
],
loader: "babel-loader"
}
]
},
target: "node",
externals: [nodeExternals()]
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment