1 | import * as path from 'path';
|
2 | import * as webpack from 'webpack';
|
3 | import { RequiredField } from '../src/sbvr-api/common-types';
|
4 | const root = path.dirname(__dirname);
|
5 |
|
6 | export = {
|
7 | mode: 'production',
|
8 | devtool: 'source-map',
|
9 | entry: root,
|
10 | output: {
|
11 | libraryTarget: 'commonjs',
|
12 | path: root,
|
13 | filename: 'out/pine.js',
|
14 | },
|
15 | target: 'node',
|
16 | node: {
|
17 | process: false,
|
18 | global: false,
|
19 | Buffer: false,
|
20 | __dirname: false,
|
21 | __filename: false,
|
22 | },
|
23 | externals: {
|
24 | bcrypt: true,
|
25 | bcryptjs: true,
|
26 | bluebird: true,
|
27 | 'body-parser': true,
|
28 | child_process: true,
|
29 | coffeescript: true,
|
30 | 'coffeescript/register': true,
|
31 | 'ts-node/register': true,
|
32 | compression: true,
|
33 | 'cookie-parser': true,
|
34 | express: true,
|
35 | 'express-session': true,
|
36 | fs: true,
|
37 | lodash: true,
|
38 | 'method-override': true,
|
39 | multer: true,
|
40 | mysql: true,
|
41 | passport: true,
|
42 | 'passport-local': true,
|
43 | 'pinejs-client-core': true,
|
44 | pg: true,
|
45 | 'serve-static': true,
|
46 | 'typed-error': true,
|
47 | },
|
48 | resolve: {
|
49 | extensions: ['.js', '.ts'],
|
50 | },
|
51 | plugins: [new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })],
|
52 | module: {
|
53 | rules: [
|
54 | { test: /\.sbvr$/, use: 'raw-loader' },
|
55 | {
|
56 | test: /\.ts$|\.js$/,
|
57 | exclude: /node_modules/,
|
58 | use: 'ts-loader',
|
59 | },
|
60 | ],
|
61 | },
|
62 | } as RequiredField<
|
63 | webpack.Configuration,
|
64 | 'plugins' | 'resolve' | 'externals'
|
65 | > & { externals: webpack.ExternalsObjectElement };
|