Created
February 25, 2020 18:40
-
-
Save fellypsantos/c58350d7fd5c8f2a8ed72fd00f84b1f7 to your computer and use it in GitHub Desktop.
Webpack configuration file, excluding devDependencies from build.
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 path = require('path'); | |
const nodeExternals = require('webpack-node-externals'); | |
const package = require('./package.json'); | |
module.exports = { | |
mode: 'production', | |
target: 'node', | |
entry: path.resolve(__dirname, 'index.js'), | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'api.bundle.js' | |
}, | |
externals: [ | |
nodeExternals({ | |
whitelist: Object.keys(package.dependencies) | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment