webpack.config.js 617 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const paths = require('path');
  3. const base = require('./webpack.base.config.js');
  4. const webpackConfig = Object.assign({}, base, {
  5. entry: require.resolve('./browser.js'),
  6. output: {
  7. filename: './dist/browser.umd.js',
  8. path: paths.resolve(__dirname, ''),
  9. library: 'mongoose',
  10. libraryTarget: 'umd',
  11. // override default 'window' globalObject so browser build will work in SSR environments
  12. // may become unnecessary in webpack 5
  13. globalObject: 'typeof self !== \'undefined\' ? self : this'
  14. },
  15. externals: [
  16. /^node_modules\/.+$/
  17. ]
  18. });
  19. module.exports = webpackConfig;