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