-
-
Notifications
You must be signed in to change notification settings - Fork 205
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (41 loc) · 1.54 KB
/
webpack.config.js
File metadata and controls
46 lines (41 loc) · 1.54 KB
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
36
37
38
39
40
41
42
43
44
45
46
/* eslint-disable */
const { composePlugins, withNx } = require('@nx/webpack');
const { name, version, ...packageConfig } = require('../../package.json');
const GeneratePackageJsonPlugin = require('generate-package-json-webpack-plugin');
const { BannerPlugin } = require('webpack');
// Nx plugins for webpack.
module.exports = composePlugins(
withNx({
target: 'node',
}),
(config) => {
const packageConfigWithoutScriptsAndDeps = {...packageConfig};
delete packageConfigWithoutScriptsAndDeps.devDependencies;
delete packageConfigWithoutScriptsAndDeps.dependencies;
delete packageConfigWithoutScriptsAndDeps.scripts;
const basePackageValues = {
...packageConfigWithoutScriptsAndDeps,
version,
name: `@${name}/openapi-generator-cli`,
description:
'A npm package wrapper for OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), generates which API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)',
scripts: {
postinstall: 'opencollective || exit 0',
},
bin: {
'openapi-generator-cli': './main.js',
},
files: ['config.schema.json', 'README.md', 'main.js'],
dependencies: {
'reflect-metadata': '',
'@nuxtjs/opencollective': '',
axios: '',
},
};
config.plugins.push(
new BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
new GeneratePackageJsonPlugin(basePackageValues),
);
return config;
},
);