Created
October 19, 2018 00:29
-
-
Save jkinkead/4f8064d62d3a56a132e20bc9379efc53 to your computer and use it in GitHub Desktop.
Webpack for a React application in the cloud
This file contains hidden or 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 path = require('path') | |
const webpack = require('webpack') | |
const nodeExternals = require("webpack-node-externals") | |
module.exports = { | |
target: 'node', | |
node: { | |
__dirname: false | |
}, | |
entry: ['./index.js'], | |
externals: [nodeExternals()], | |
output: { | |
libraryTarget: "commonjs", | |
filename: 'index.js' | |
}, | |
mode: "development", | |
module: { | |
rules: [{ | |
test: /.js$/, | |
exclude: /node_modules/, | |
use: [ | |
{ | |
loader: 'babel-loader', | |
options: { | |
presets: ['@babel/preset-env', '@babel/react'] | |
} | |
} | |
] | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment