-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.ts
35 lines (31 loc) · 1.02 KB
/
webpack.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Configuration, DefinePlugin } from 'webpack';
import { CustomWebpackBrowserSchema, TargetOptions } from '@angular-builders/custom-webpack';
import * as path from 'path';
import * as pkg from './package.json';
import { AngularServerServicePlugin } from './webpack/AngularServerServicePlugin';
export default (
cfg: Configuration,
opts: CustomWebpackBrowserSchema,
targetOptions: TargetOptions
) => {
const isServer = targetOptions.target === 'server';
cfg?.plugins?.push(
new DefinePlugin({
APP_VERSION: JSON.stringify(pkg.version),
}),
);
// if (!isServer) {
// cfg?.plugins?.push(
// new AngularServerServicePlugin({
// "target": isServer ? 'server' : 'browser',
// // TODO: grab server config from angular.json
// "serverConfig": path.join(__dirname, 'src/app/app.config.server.ts'),
// // TODO: grab all components in @server folder
// "serverComponents": [
// "ExampleService"
// ]
// })
// );
// }
return cfg;
};