Created
February 25, 2020 18:40
Webpack configuration file, excluding devDependencies from build.
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 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