@nx/webpack 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/executors.json +36 -0
- package/generators.json +33 -0
- package/index.d.ts +12 -0
- package/index.js +14 -0
- package/index.js.map +1 -0
- package/migrations.json +35 -0
- package/package.json +79 -0
- package/src/executors/dev-server/compat.d.ts +2 -0
- package/src/executors/dev-server/compat.js +6 -0
- package/src/executors/dev-server/compat.js.map +1 -0
- package/src/executors/dev-server/dev-server.impl.d.ts +7 -0
- package/src/executors/dev-server/dev-server.impl.js +69 -0
- package/src/executors/dev-server/dev-server.impl.js.map +1 -0
- package/src/executors/dev-server/lib/get-dev-server-config.d.ts +5 -0
- package/src/executors/dev-server/lib/get-dev-server-config.js +89 -0
- package/src/executors/dev-server/lib/get-dev-server-config.js.map +1 -0
- package/src/executors/dev-server/lib/serve-path.d.ts +3 -0
- package/src/executors/dev-server/lib/serve-path.js +46 -0
- package/src/executors/dev-server/lib/serve-path.js.map +1 -0
- package/src/executors/dev-server/schema.d.ts +17 -0
- package/src/executors/dev-server/schema.json +76 -0
- package/src/executors/ssr-dev-server/compat.d.ts +2 -0
- package/src/executors/ssr-dev-server/compat.js +6 -0
- package/src/executors/ssr-dev-server/compat.js.map +1 -0
- package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts +1 -0
- package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.js +40 -0
- package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.js.map +1 -0
- package/src/executors/ssr-dev-server/schema.d.ts +11 -0
- package/src/executors/ssr-dev-server/schema.json +37 -0
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts +8 -0
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.js +59 -0
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.js.map +1 -0
- package/src/executors/webpack/compat.d.ts +2 -0
- package/src/executors/webpack/compat.js +6 -0
- package/src/executors/webpack/compat.js.map +1 -0
- package/src/executors/webpack/lib/get-webpack-config.d.ts +5 -0
- package/src/executors/webpack/lib/get-webpack-config.js +17 -0
- package/src/executors/webpack/lib/get-webpack-config.js.map +1 -0
- package/src/executors/webpack/lib/normalize-options.d.ts +4 -0
- package/src/executors/webpack/lib/normalize-options.js +71 -0
- package/src/executors/webpack/lib/normalize-options.js.map +1 -0
- package/src/executors/webpack/lib/run-webpack.d.ts +3 -0
- package/src/executors/webpack/lib/run-webpack.js +38 -0
- package/src/executors/webpack/lib/run-webpack.js.map +1 -0
- package/src/executors/webpack/schema.d.ts +105 -0
- package/src/executors/webpack/schema.json +414 -0
- package/src/executors/webpack/webpack.impl.d.ts +14 -0
- package/src/executors/webpack/webpack.impl.js +107 -0
- package/src/executors/webpack/webpack.impl.js.map +1 -0
- package/src/generators/init/init.d.ts +5 -0
- package/src/generators/init/init.js +41 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/schema.d.ts +5 -0
- package/src/generators/init/schema.json +28 -0
- package/src/generators/webpack-project/schema.d.ts +13 -0
- package/src/generators/webpack-project/schema.json +77 -0
- package/src/generators/webpack-project/webpack-project.d.ts +5 -0
- package/src/generators/webpack-project/webpack-project.js +111 -0
- package/src/generators/webpack-project/webpack-project.js.map +1 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js +13 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +1 -0
- package/src/migrations/update-15-4-5/remove-es2015-polyfills-option.d.ts +2 -0
- package/src/migrations/update-15-4-5/remove-es2015-polyfills-option.js +25 -0
- package/src/migrations/update-15-4-5/remove-es2015-polyfills-option.js.map +1 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.d.ts +2 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.js +105 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.js.map +1 -0
- package/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.d.ts +2 -0
- package/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.js +21 -0
- package/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/plugins/generate-package-json-plugin.d.ts +12 -0
- package/src/plugins/generate-package-json-plugin.js +49 -0
- package/src/plugins/generate-package-json-plugin.js.map +1 -0
- package/src/plugins/stats-json-plugin.d.ts +4 -0
- package/src/plugins/stats-json-plugin.js +14 -0
- package/src/plugins/stats-json-plugin.js.map +1 -0
- package/src/plugins/webpack-nx-build-coordination-plugin.d.ts +9 -0
- package/src/plugins/webpack-nx-build-coordination-plugin.js +84 -0
- package/src/plugins/webpack-nx-build-coordination-plugin.js.map +1 -0
- package/src/plugins/write-index-html-plugin.d.ts +22 -0
- package/src/plugins/write-index-html-plugin.js +251 -0
- package/src/plugins/write-index-html-plugin.js.map +1 -0
- package/src/utils/config.d.ts +17 -0
- package/src/utils/config.js +35 -0
- package/src/utils/config.js.map +1 -0
- package/src/utils/create-copy-plugin.d.ts +3 -0
- package/src/utils/create-copy-plugin.js +28 -0
- package/src/utils/create-copy-plugin.js.map +1 -0
- package/src/utils/fs.d.ts +6 -0
- package/src/utils/fs.js +59 -0
- package/src/utils/fs.js.map +1 -0
- package/src/utils/get-client-environment.d.ts +5 -0
- package/src/utils/get-client-environment.js +30 -0
- package/src/utils/get-client-environment.js.map +1 -0
- package/src/utils/get-css-module-local-ident.d.ts +1 -0
- package/src/utils/get-css-module-local-ident.js +19 -0
- package/src/utils/get-css-module-local-ident.js.map +1 -0
- package/src/utils/hash-format.d.ts +7 -0
- package/src/utils/hash-format.js +24 -0
- package/src/utils/hash-format.js.map +1 -0
- package/src/utils/models.d.ts +23 -0
- package/src/utils/models.js +3 -0
- package/src/utils/models.js.map +1 -0
- package/src/utils/run-webpack.d.ts +5 -0
- package/src/utils/run-webpack.js +30 -0
- package/src/utils/run-webpack.js.map +1 -0
- package/src/utils/versions.d.ts +8 -0
- package/src/utils/versions.js +13 -0
- package/src/utils/versions.js.map +1 -0
- package/src/utils/web-babel-loader.d.ts +0 -0
- package/src/utils/web-babel-loader.js +29 -0
- package/src/utils/web-babel-loader.js.map +1 -0
- package/src/utils/webpack/custom-webpack.d.ts +3 -0
- package/src/utils/webpack/custom-webpack.js +42 -0
- package/src/utils/webpack/custom-webpack.js.map +1 -0
- package/src/utils/webpack/interpolate-env-variables-to-index.d.ts +1 -0
- package/src/utils/webpack/interpolate-env-variables-to-index.js +31 -0
- package/src/utils/webpack/interpolate-env-variables-to-index.js.map +1 -0
- package/src/utils/webpack/normalize-entry.d.ts +2 -0
- package/src/utils/webpack/normalize-entry.js +30 -0
- package/src/utils/webpack/normalize-entry.js.map +1 -0
- package/src/utils/webpack/package-chunk-sort.d.ts +5 -0
- package/src/utils/webpack/package-chunk-sort.js +30 -0
- package/src/utils/webpack/package-chunk-sort.js.map +1 -0
- package/src/utils/webpack/plugins/postcss-cli-resources.d.ts +13 -0
- package/src/utils/webpack/plugins/postcss-cli-resources.js +170 -0
- package/src/utils/webpack/plugins/postcss-cli-resources.js.map +1 -0
- package/src/utils/webpack/plugins/scripts-webpack-plugin.d.ts +17 -0
- package/src/utils/webpack/plugins/scripts-webpack-plugin.js +121 -0
- package/src/utils/webpack/plugins/scripts-webpack-plugin.js.map +1 -0
- package/src/utils/with-nx.d.ts +61 -0
- package/src/utils/with-nx.js +285 -0
- package/src/utils/with-nx.js.map +1 -0
- package/src/utils/with-web.d.ts +21 -0
- package/src/utils/with-web.js +468 -0
- package/src/utils/with-web.js.map +1 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2023 Narwhal Technologies Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
|
|
2
|
+
|
|
3
|
+
<div style="text-align: center;">
|
|
4
|
+
|
|
5
|
+
[](https://circleci.com/gh/nrwl/nx)
|
|
6
|
+
[]()
|
|
7
|
+
[](https://www.npmjs.com/@nrwl/workspace)
|
|
8
|
+
[]()
|
|
9
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
10
|
+
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
11
|
+
[](https://join.slack.com/t/nrwlcommunity/shared_invite/enQtNzU5MTE4OTQwOTk0LTgxY2E0ZWYzMWE0YzA5ZDA2MWM1NDVhNmI2ZWMyYmZhNWJiODk3MjkxZjY3MzU5ZjRmM2NmNWU1OTgyZmE4Mzc)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<hr>
|
|
17
|
+
|
|
18
|
+
# Nx: Smart, Fast and Extensible Build System
|
|
19
|
+
|
|
20
|
+
Nx is a next generation build system with first class monorepo support and powerful integrations.
|
|
21
|
+
|
|
22
|
+
This package is a [Webpack plugin for Nx](https://nx.dev/packages/webpack).
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
### Creating an Nx Workspace
|
|
27
|
+
|
|
28
|
+
**Using `npx`**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx create-nx-workspace
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Using `npm init`**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm init nx-workspace
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Using `yarn create`**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
yarn create nx-workspace
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Adding Nx to an Existing Repository
|
|
47
|
+
|
|
48
|
+
Run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx nx@latest init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Documentation & Resources
|
|
55
|
+
|
|
56
|
+
- [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
|
|
57
|
+
- [Intro to Nx](https://nx.dev/getting-started/intro)
|
|
58
|
+
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
|
59
|
+
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
60
|
+
|
|
61
|
+
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
62
|
+
width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
|
|
63
|
+
|
package/executors.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"builders": {
|
|
3
|
+
"webpack": {
|
|
4
|
+
"implementation": "./src/executors/webpack/compat",
|
|
5
|
+
"schema": "./src/executors/webpack/schema.json",
|
|
6
|
+
"description": "Run webpack build."
|
|
7
|
+
},
|
|
8
|
+
"dev-server": {
|
|
9
|
+
"implementation": "./src/executors/dev-server/compat",
|
|
10
|
+
"schema": "./src/executors/dev-server/schema.json",
|
|
11
|
+
"description": "Serve a web application."
|
|
12
|
+
},
|
|
13
|
+
"ssr-dev-server": {
|
|
14
|
+
"implementation": "./src/executors/ssr-dev-server/compat",
|
|
15
|
+
"schema": "./src/executors/ssr-dev-server/schema.json",
|
|
16
|
+
"description": "Serve a SSR application."
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"executors": {
|
|
20
|
+
"webpack": {
|
|
21
|
+
"implementation": "./src/executors/webpack/webpack.impl",
|
|
22
|
+
"schema": "./src/executors/webpack/schema.json",
|
|
23
|
+
"description": "Run webpack build."
|
|
24
|
+
},
|
|
25
|
+
"dev-server": {
|
|
26
|
+
"implementation": "./src/executors/dev-server/dev-server.impl",
|
|
27
|
+
"schema": "./src/executors/dev-server/schema.json",
|
|
28
|
+
"description": "Serve a web application."
|
|
29
|
+
},
|
|
30
|
+
"ssr-dev-server": {
|
|
31
|
+
"implementation": "./src/executors/ssr-dev-server/ssr-dev-server.impl",
|
|
32
|
+
"schema": "./src/executors/ssr-dev-server/schema.json",
|
|
33
|
+
"description": "Serve a SSR application."
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/generators.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Nx Webpack",
|
|
3
|
+
"version": "0.1",
|
|
4
|
+
"schematics": {
|
|
5
|
+
"init": {
|
|
6
|
+
"factory": "./src/generators/init/init#webpackInitSchematic",
|
|
7
|
+
"schema": "./src/generators/init/schema.json",
|
|
8
|
+
"description": "Initialize the `@nrwl/webpack` plugin.",
|
|
9
|
+
"hidden": true
|
|
10
|
+
},
|
|
11
|
+
"webpack-project": {
|
|
12
|
+
"factory": "./src/generators/webpack-project/webpack-project#webpackProjectSchematic",
|
|
13
|
+
"schema": "./src/generators/webpack-project/schema.json",
|
|
14
|
+
"description": "Add webpack configuration to a project.",
|
|
15
|
+
"hidden": true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"generators": {
|
|
19
|
+
"init": {
|
|
20
|
+
"factory": "./src/generators/init/init#webpackInitGenerator",
|
|
21
|
+
"schema": "./src/generators/init/schema.json",
|
|
22
|
+
"description": "Initialize the `@nrwl/webpack` plugin.",
|
|
23
|
+
"aliases": ["ng-add"],
|
|
24
|
+
"hidden": true
|
|
25
|
+
},
|
|
26
|
+
"webpack-project": {
|
|
27
|
+
"factory": "./src/generators/webpack-project/webpack-project#webpackProjectGenerator",
|
|
28
|
+
"schema": "./src/generators/webpack-project/schema.json",
|
|
29
|
+
"description": "Add webpack configuration to a project.",
|
|
30
|
+
"hidden": true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './src/utils/create-copy-plugin';
|
|
2
|
+
export * from './src/utils/config';
|
|
3
|
+
export * from './src/generators/init/init';
|
|
4
|
+
export * from './src/generators/webpack-project/webpack-project';
|
|
5
|
+
export type { WebDevServerOptions } from './src/executors/dev-server/schema';
|
|
6
|
+
export * from './src/executors/dev-server/dev-server.impl';
|
|
7
|
+
export * from './src/executors/webpack/lib/normalize-options';
|
|
8
|
+
export type { WebpackExecutorOptions, NormalizedWebpackExecutorOptions, AssetGlobPattern, FileReplacement, } from './src/executors/webpack/schema';
|
|
9
|
+
export * from './src/executors/webpack/webpack.impl';
|
|
10
|
+
export * from './src/utils/get-css-module-local-ident';
|
|
11
|
+
export * from './src/utils/with-nx';
|
|
12
|
+
export * from './src/utils/with-web';
|
package/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./src/utils/create-copy-plugin"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./src/utils/config"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./src/generators/webpack-project/webpack-project"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./src/executors/dev-server/dev-server.impl"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./src/executors/webpack/lib/normalize-options"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./src/executors/webpack/webpack.impl"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./src/utils/get-css-module-local-ident"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./src/utils/with-nx"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./src/utils/with-web"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/webpack/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,6DAAmC;AACnC,qEAA2C;AAC3C,2FAAiE;AAEjE,qFAA2D;AAC3D,wFAA8D;AAO9D,+EAAqD;AACrD,iFAAuD;AACvD,8DAAoC;AACpC,+DAAqC"}
|
package/migrations.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"add-babel-inputs": {
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"version": "15.0.0-beta.0",
|
|
6
|
+
"description": "Adds babel.config.json to the hash of all tasks",
|
|
7
|
+
"factory": "./src/migrations/update-15-0-0/add-babel-inputs"
|
|
8
|
+
},
|
|
9
|
+
"remove-es2015-polyfills-option": {
|
|
10
|
+
"cli": "nx",
|
|
11
|
+
"version": "15.4.5-beta.0",
|
|
12
|
+
"description": "Removes es2015Polyfills option since legacy browsers are no longer supported.",
|
|
13
|
+
"factory": "./src/migrations/update-15-4-5/remove-es2015-polyfills-option"
|
|
14
|
+
},
|
|
15
|
+
"webpack-config-setup": {
|
|
16
|
+
"cli": "nx",
|
|
17
|
+
"version": "15.6.3-beta.0",
|
|
18
|
+
"description": "Creates or updates webpack.config.js file with the new options for webpack.",
|
|
19
|
+
"factory": "./src/migrations/update-15-6-3/webpack-config-setup"
|
|
20
|
+
},
|
|
21
|
+
"add-babelUpwardRootMode-flag": {
|
|
22
|
+
"cli": "nx",
|
|
23
|
+
"version": "15.7.2-beta.0",
|
|
24
|
+
"description": "Add the babelUpwardRootMode option to the build executor options.",
|
|
25
|
+
"factory": "./src/migrations/update-15-7-2/add-babelUpwardRootMode-flag"
|
|
26
|
+
},
|
|
27
|
+
"update-16-0-0-add-nx-packages": {
|
|
28
|
+
"cli": "nx",
|
|
29
|
+
"version": "16.0.0-beta.1",
|
|
30
|
+
"description": "Replace @nrwl/webpack with @nx/webpack",
|
|
31
|
+
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"packageJsonUpdates": {}
|
|
35
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nx/webpack",
|
|
3
|
+
"version": "16.0.0-beta.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "The Nx Plugin for Webpack contains executors and generators that support building applications using Webpack.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nrwl/nx.git",
|
|
9
|
+
"directory": "packages/webpack"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"Monorepo",
|
|
13
|
+
"Webpack",
|
|
14
|
+
"Web",
|
|
15
|
+
"CLI"
|
|
16
|
+
],
|
|
17
|
+
"main": "./index",
|
|
18
|
+
"typings": "./index.d.ts",
|
|
19
|
+
"author": "Victor Savkin",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/nrwl/nx/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://nx.dev",
|
|
25
|
+
"schematics": "./generators.json",
|
|
26
|
+
"builders": "./executors.json",
|
|
27
|
+
"ng-update": {
|
|
28
|
+
"requirements": {},
|
|
29
|
+
"migrations": "./migrations.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@babel/core": "^7.15.0",
|
|
33
|
+
"@nrwl/webpack": "16.0.0-beta.1",
|
|
34
|
+
"@nx/devkit": "16.0.0-beta.1",
|
|
35
|
+
"@nx/js": "16.0.0-beta.1",
|
|
36
|
+
"autoprefixer": "^10.4.9",
|
|
37
|
+
"babel-loader": "^9.1.2",
|
|
38
|
+
"chalk": "^4.1.0",
|
|
39
|
+
"chokidar": "^3.5.1",
|
|
40
|
+
"copy-webpack-plugin": "^10.2.4",
|
|
41
|
+
"css-loader": "^6.4.0",
|
|
42
|
+
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
43
|
+
"dotenv": "~10.0.0",
|
|
44
|
+
"file-loader": "^6.2.0",
|
|
45
|
+
"fork-ts-checker-webpack-plugin": "7.2.13",
|
|
46
|
+
"ignore": "^5.0.4",
|
|
47
|
+
"less": "4.1.3",
|
|
48
|
+
"less-loader": "11.1.0",
|
|
49
|
+
"license-webpack-plugin": "^4.0.2",
|
|
50
|
+
"loader-utils": "^2.0.3",
|
|
51
|
+
"mini-css-extract-plugin": "~2.4.7",
|
|
52
|
+
"parse5": "4.0.0",
|
|
53
|
+
"postcss": "^8.4.14",
|
|
54
|
+
"postcss-import": "~14.1.0",
|
|
55
|
+
"postcss-loader": "^6.1.1",
|
|
56
|
+
"rxjs": "^6.5.4",
|
|
57
|
+
"sass": "^1.42.1",
|
|
58
|
+
"sass-loader": "^12.2.0",
|
|
59
|
+
"source-map-loader": "^3.0.0",
|
|
60
|
+
"style-loader": "^3.3.0",
|
|
61
|
+
"stylus": "^0.55.0",
|
|
62
|
+
"stylus-loader": "^7.1.0",
|
|
63
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
64
|
+
"ts-loader": "^9.3.1",
|
|
65
|
+
"ts-node": "10.9.1",
|
|
66
|
+
"tsconfig-paths": "^4.1.2",
|
|
67
|
+
"tsconfig-paths-webpack-plugin": "4.0.0",
|
|
68
|
+
"tslib": "^2.3.0",
|
|
69
|
+
"webpack": "^5.75.0",
|
|
70
|
+
"webpack-dev-server": "^4.9.3",
|
|
71
|
+
"webpack-node-externals": "^3.0.0",
|
|
72
|
+
"webpack-subresource-integrity": "^5.1.0"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public"
|
|
76
|
+
},
|
|
77
|
+
"types": "./index.d.ts",
|
|
78
|
+
"gitHead": "abf534c265f5aa3aac146e55bb31de598ea281d7"
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const dev_server_impl_1 = require("./dev-server.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(dev_server_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/dev-server/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,uDAAkD;AAElD,kBAAe,IAAA,0BAAiB,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { WebDevServerOptions } from './schema';
|
|
3
|
+
export declare function devServerExecutor(serveOptions: WebDevServerOptions, context: ExecutorContext): AsyncGenerator<{
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
success: boolean;
|
|
6
|
+
}, any, undefined>;
|
|
7
|
+
export default devServerExecutor;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.devServerExecutor = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const webpack = require("webpack");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
9
|
+
const WebpackDevServer = require("webpack-dev-server");
|
|
10
|
+
const get_dev_server_config_1 = require("./lib/get-dev-server-config");
|
|
11
|
+
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
12
|
+
const run_webpack_1 = require("../../utils/run-webpack");
|
|
13
|
+
const custom_webpack_1 = require("../../utils/webpack/custom-webpack");
|
|
14
|
+
const normalize_options_1 = require("../webpack/lib/normalize-options");
|
|
15
|
+
function devServerExecutor(serveOptions, context) {
|
|
16
|
+
var _a;
|
|
17
|
+
var _b;
|
|
18
|
+
return tslib_1.__asyncGenerator(this, arguments, function* devServerExecutor_1() {
|
|
19
|
+
// Default to dev mode so builds are faster and HMR mode works better.
|
|
20
|
+
(_a = (_b = process.env).NODE_ENV) !== null && _a !== void 0 ? _a : (_b.NODE_ENV = 'development');
|
|
21
|
+
const { root: projectRoot, sourceRoot } = context.projectsConfigurations.projects[context.projectName];
|
|
22
|
+
const buildOptions = (0, normalize_options_1.normalizeOptions)(getBuildOptions(serveOptions, context), context.root, projectRoot, sourceRoot);
|
|
23
|
+
if (!buildOptions.index) {
|
|
24
|
+
throw new Error(`Cannot run dev-server without "index" option. Check the build options for ${context.projectName}.`);
|
|
25
|
+
}
|
|
26
|
+
if (!buildOptions.buildLibsFromSource) {
|
|
27
|
+
const { target, dependencies } = (0, buildable_libs_utils_1.calculateProjectDependencies)(context.projectGraph, context.root, context.projectName, 'build', // should be generalized
|
|
28
|
+
context.configurationName);
|
|
29
|
+
buildOptions.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)(buildOptions.tsConfig, context.root, target.data.root, dependencies);
|
|
30
|
+
}
|
|
31
|
+
let config = (0, get_dev_server_config_1.getDevServerConfig)(context, buildOptions, serveOptions);
|
|
32
|
+
if (buildOptions.webpackConfig) {
|
|
33
|
+
let customWebpack = (0, custom_webpack_1.resolveCustomWebpackConfig)(buildOptions.webpackConfig, buildOptions.tsConfig);
|
|
34
|
+
if (typeof customWebpack.then === 'function') {
|
|
35
|
+
customWebpack = yield tslib_1.__await(customWebpack);
|
|
36
|
+
}
|
|
37
|
+
config = yield tslib_1.__await(customWebpack(config, {
|
|
38
|
+
options: buildOptions,
|
|
39
|
+
context,
|
|
40
|
+
configuration: serveOptions.buildTarget.split(':')[2],
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues((0, rxjs_for_await_1.eachValueFrom)((0, run_webpack_1.runWebpackDevServer)(config, webpack, WebpackDevServer).pipe((0, operators_1.tap)(({ stats }) => {
|
|
44
|
+
console.info(stats.toString(config.stats));
|
|
45
|
+
}), (0, operators_1.map)(({ baseUrl, stats }) => {
|
|
46
|
+
return {
|
|
47
|
+
baseUrl,
|
|
48
|
+
success: !stats.hasErrors(),
|
|
49
|
+
};
|
|
50
|
+
})))))));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.devServerExecutor = devServerExecutor;
|
|
54
|
+
function getBuildOptions(options, context) {
|
|
55
|
+
const target = (0, devkit_1.parseTargetString)(options.buildTarget, context.projectGraph);
|
|
56
|
+
const overrides = {
|
|
57
|
+
watch: false,
|
|
58
|
+
};
|
|
59
|
+
if (options.memoryLimit) {
|
|
60
|
+
overrides.memoryLimit = options.memoryLimit;
|
|
61
|
+
}
|
|
62
|
+
if (options.baseHref) {
|
|
63
|
+
overrides.baseHref = options.baseHref;
|
|
64
|
+
}
|
|
65
|
+
const buildOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
66
|
+
return Object.assign(Object.assign({}, buildOptions), overrides);
|
|
67
|
+
}
|
|
68
|
+
exports.default = devServerExecutor;
|
|
69
|
+
//# sourceMappingURL=dev-server.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/webpack/src/executors/dev-server/dev-server.impl.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import type { Configuration as WebpackConfiguration } from 'webpack';
|
|
3
|
+
import { WebDevServerOptions } from '../schema';
|
|
4
|
+
import { NormalizedWebpackExecutorOptions } from '../../webpack/schema';
|
|
5
|
+
export declare function getDevServerConfig(context: ExecutorContext, buildOptions: NormalizedWebpackExecutorOptions, serveOptions: WebDevServerOptions): Partial<WebpackConfiguration>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDevServerConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const get_webpack_config_1 = require("../../webpack/lib/get-webpack-config");
|
|
8
|
+
const serve_path_1 = require("./serve-path");
|
|
9
|
+
function getDevServerConfig(context, buildOptions, serveOptions) {
|
|
10
|
+
const workspaceRoot = context.root;
|
|
11
|
+
const webpackConfig = buildOptions.isolatedConfig
|
|
12
|
+
? {}
|
|
13
|
+
: (0, get_webpack_config_1.getWebpackConfig)(context, buildOptions);
|
|
14
|
+
webpackConfig.devServer = getDevServerPartial(workspaceRoot, serveOptions, buildOptions);
|
|
15
|
+
return webpackConfig;
|
|
16
|
+
}
|
|
17
|
+
exports.getDevServerConfig = getDevServerConfig;
|
|
18
|
+
function getDevServerPartial(root, options, buildOptions) {
|
|
19
|
+
const servePath = (0, serve_path_1.buildServePath)(buildOptions);
|
|
20
|
+
let scriptsOptimization;
|
|
21
|
+
let stylesOptimization;
|
|
22
|
+
if (typeof buildOptions.optimization === 'boolean') {
|
|
23
|
+
scriptsOptimization = stylesOptimization = buildOptions.optimization;
|
|
24
|
+
}
|
|
25
|
+
else if (buildOptions.optimization) {
|
|
26
|
+
scriptsOptimization = buildOptions.optimization.scripts;
|
|
27
|
+
stylesOptimization = buildOptions.optimization.styles;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
scriptsOptimization = stylesOptimization = false;
|
|
31
|
+
}
|
|
32
|
+
const config = {
|
|
33
|
+
host: options.host,
|
|
34
|
+
port: options.port,
|
|
35
|
+
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
36
|
+
historyApiFallback: {
|
|
37
|
+
index: `${servePath}${path.basename(buildOptions.index)}`,
|
|
38
|
+
disableDotRule: true,
|
|
39
|
+
htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
|
|
40
|
+
},
|
|
41
|
+
onListening(server) {
|
|
42
|
+
var _a;
|
|
43
|
+
const isHttps = server.options.https || ((_a = server.options.server) === null || _a === void 0 ? void 0 : _a.type) === 'https';
|
|
44
|
+
devkit_1.logger.info(`NX Web Development Server is listening at ${isHttps ? 'https' : 'http'}://${server.options.host}:${server.options.port}${(0, serve_path_1.buildServePath)(buildOptions)}`);
|
|
45
|
+
},
|
|
46
|
+
open: options.open,
|
|
47
|
+
static: false,
|
|
48
|
+
compress: scriptsOptimization || stylesOptimization,
|
|
49
|
+
devMiddleware: {
|
|
50
|
+
publicPath: servePath,
|
|
51
|
+
stats: false,
|
|
52
|
+
},
|
|
53
|
+
client: {
|
|
54
|
+
webSocketURL: options.publicHost,
|
|
55
|
+
overlay: {
|
|
56
|
+
errors: !(scriptsOptimization || stylesOptimization),
|
|
57
|
+
warnings: false,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
liveReload: options.hmr ? false : options.liveReload,
|
|
61
|
+
hot: options.hmr,
|
|
62
|
+
};
|
|
63
|
+
if (options.ssl) {
|
|
64
|
+
config.server = {
|
|
65
|
+
type: 'https',
|
|
66
|
+
};
|
|
67
|
+
if (options.sslKey && options.sslCert) {
|
|
68
|
+
config.server.options = getSslConfig(root, options);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (options.proxyConfig) {
|
|
72
|
+
config.proxy = getProxyConfig(root, options);
|
|
73
|
+
}
|
|
74
|
+
if (options.allowedHosts) {
|
|
75
|
+
config.allowedHosts = options.allowedHosts.split(',');
|
|
76
|
+
}
|
|
77
|
+
return config;
|
|
78
|
+
}
|
|
79
|
+
function getSslConfig(root, options) {
|
|
80
|
+
return {
|
|
81
|
+
key: (0, fs_1.readFileSync)(path.resolve(root, options.sslKey), 'utf-8'),
|
|
82
|
+
cert: (0, fs_1.readFileSync)(path.resolve(root, options.sslCert), 'utf-8'),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function getProxyConfig(root, options) {
|
|
86
|
+
const proxyPath = path.resolve(root, options.proxyConfig);
|
|
87
|
+
return require(proxyPath);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=get-dev-server-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-dev-server-config.js","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/executors/dev-server/lib/get-dev-server-config.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NormalizedWebpackExecutorOptions } from '../../webpack/schema';
|
|
2
|
+
export declare function buildServePath(browserOptions: NormalizedWebpackExecutorOptions): string;
|
|
3
|
+
export declare function _findDefaultServePath(baseHref?: string, deployUrl?: string): string | null;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._findDefaultServePath = exports.buildServePath = void 0;
|
|
4
|
+
function buildServePath(browserOptions) {
|
|
5
|
+
let servePath = _findDefaultServePath(browserOptions.baseHref, browserOptions.deployUrl) ||
|
|
6
|
+
'/';
|
|
7
|
+
if (servePath.endsWith('/')) {
|
|
8
|
+
servePath = servePath.slice(0, -1);
|
|
9
|
+
}
|
|
10
|
+
if (!servePath.startsWith('/')) {
|
|
11
|
+
servePath = `/${servePath}`;
|
|
12
|
+
}
|
|
13
|
+
return servePath;
|
|
14
|
+
}
|
|
15
|
+
exports.buildServePath = buildServePath;
|
|
16
|
+
function _findDefaultServePath(baseHref, deployUrl) {
|
|
17
|
+
if (!baseHref && !deployUrl) {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
if (/^(\w+:)?\/\//.test(baseHref || '') ||
|
|
21
|
+
/^(\w+:)?\/\//.test(deployUrl || '')) {
|
|
22
|
+
// If baseHref or deployUrl is absolute, unsupported by nx serve
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
// normalize baseHref
|
|
26
|
+
// for nx serve the starting base is always `/` so a relative
|
|
27
|
+
// and root relative value are identical
|
|
28
|
+
const baseHrefParts = (baseHref || '')
|
|
29
|
+
.split('/')
|
|
30
|
+
.filter((part) => part !== '');
|
|
31
|
+
if (baseHref && !baseHref.endsWith('/')) {
|
|
32
|
+
baseHrefParts.pop();
|
|
33
|
+
}
|
|
34
|
+
const normalizedBaseHref = baseHrefParts.length === 0 ? '/' : `/${baseHrefParts.join('/')}/`;
|
|
35
|
+
if (deployUrl && deployUrl[0] === '/') {
|
|
36
|
+
if (baseHref && baseHref[0] === '/' && normalizedBaseHref !== deployUrl) {
|
|
37
|
+
// If baseHref and deployUrl are root relative and not equivalent, unsupported by nx serve
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return deployUrl;
|
|
41
|
+
}
|
|
42
|
+
// Join together baseHref and deployUrl
|
|
43
|
+
return `${normalizedBaseHref}${deployUrl || ''}`;
|
|
44
|
+
}
|
|
45
|
+
exports._findDefaultServePath = _findDefaultServePath;
|
|
46
|
+
//# sourceMappingURL=serve-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-path.js","sourceRoot":"","sources":["../../../../../../../packages/webpack/src/executors/dev-server/lib/serve-path.ts"],"names":[],"mappings":";;;AAEA,SAAgB,cAAc,CAC5B,cAAgD;IAEhD,IAAI,SAAS,GACX,qBAAqB,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC;QACxE,GAAG,CAAC;IACN,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC3B,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACpC;IACD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC9B,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;KAC7B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAdD,wCAcC;AAED,SAAgB,qBAAqB,CACnC,QAAiB,EACjB,SAAkB;IAElB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,EAAE;QAC3B,OAAO,EAAE,CAAC;KACX;IAED,IACE,cAAc,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACnC,cAAc,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,EACpC;QACA,gEAAgE;QAChE,OAAO,IAAI,CAAC;KACb;IAED,qBAAqB;IACrB,6DAA6D;IAC7D,wCAAwC;IACxC,MAAM,aAAa,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;SACnC,KAAK,CAAC,GAAG,CAAC;SACV,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;IACjC,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACvC,aAAa,CAAC,GAAG,EAAE,CAAC;KACrB;IACD,MAAM,kBAAkB,GACtB,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAEpE,IAAI,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACrC,IAAI,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,kBAAkB,KAAK,SAAS,EAAE;YACvE,0FAA0F;YAC1F,OAAO,IAAI,CAAC;SACb;QAED,OAAO,SAAS,CAAC;KAClB;IAED,uCAAuC;IACvC,OAAO,GAAG,kBAAkB,GAAG,SAAS,IAAI,EAAE,EAAE,CAAC;AACnD,CAAC;AAvCD,sDAuCC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface WebDevServerOptions {
|
|
2
|
+
host: string;
|
|
3
|
+
port: number;
|
|
4
|
+
publicHost?: string;
|
|
5
|
+
ssl: boolean;
|
|
6
|
+
sslKey?: string;
|
|
7
|
+
sslCert?: string;
|
|
8
|
+
proxyConfig?: string;
|
|
9
|
+
buildTarget: string;
|
|
10
|
+
open: boolean;
|
|
11
|
+
liveReload: boolean;
|
|
12
|
+
hmr: boolean;
|
|
13
|
+
watch: boolean;
|
|
14
|
+
allowedHosts: string;
|
|
15
|
+
memoryLimit?: number;
|
|
16
|
+
baseHref?: string;
|
|
17
|
+
}
|