webpack.config.js 446 B

123456789101112131415161718
  1. const path = require('path');
  2. const nodeExternals = require('webpack-node-externals');
  3. const webpack = require('webpack');
  4. module.exports = {
  5. target: 'node',
  6. entry: './server/index',
  7. output: {
  8. path: path.resolve(__dirname, '../.next'),
  9. filename: 'server.bundle.js',
  10. },
  11. plugins: [
  12. new webpack.DefinePlugin({
  13. 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
  14. }),
  15. ],
  16. externals: [nodeExternals()],
  17. };