@angular-devkit/build-webpack 0.1201.0-next.4 → 0.1201.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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-webpack",
|
|
3
|
-
"version": "0.1201.
|
|
3
|
+
"version": "0.1201.1",
|
|
4
4
|
"description": "Webpack Builder for Architect",
|
|
5
5
|
"experimental": true,
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"typings": "src/index.d.ts",
|
|
8
8
|
"builders": "builders.json",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@angular-devkit/architect": "0.1201.
|
|
10
|
+
"@angular-devkit/architect": "0.1201.1",
|
|
11
11
|
"rxjs": "6.6.7"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
package/src/utils.js
CHANGED
|
@@ -6,9 +6,28 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
29
|
exports.getEmittedFiles = void 0;
|
|
11
|
-
const path = require("path");
|
|
30
|
+
const path = __importStar(require("path"));
|
|
12
31
|
function getEmittedFiles(compilation) {
|
|
13
32
|
const files = [];
|
|
14
33
|
// adds all chunks to the list of emitted files such as lazy loaded modules
|
package/src/webpack/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
10
|
-
import
|
|
10
|
+
import webpack from 'webpack';
|
|
11
11
|
import { EmittedFiles } from '../utils';
|
|
12
12
|
import { Schema as RealWebpackBuilderSchema } from './schema';
|
|
13
13
|
export declare type WebpackBuilderSchema = RealWebpackBuilderSchema;
|
package/src/webpack/index.js
CHANGED
|
@@ -6,13 +6,35 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.runWebpack = void 0;
|
|
11
33
|
const architect_1 = require("@angular-devkit/architect");
|
|
12
34
|
const path_1 = require("path");
|
|
13
35
|
const rxjs_1 = require("rxjs");
|
|
14
36
|
const operators_1 = require("rxjs/operators");
|
|
15
|
-
const
|
|
37
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
16
38
|
const utils_1 = require("../utils");
|
|
17
39
|
function runWebpack(config, context, options = {}) {
|
|
18
40
|
const { logging: log = (stats, config) => context.logger.info(stats.toString(config.stats)), shouldProvideStats = true, } = options;
|
|
@@ -27,7 +49,7 @@ function runWebpack(config, context, options = {}) {
|
|
|
27
49
|
}
|
|
28
50
|
}
|
|
29
51
|
else {
|
|
30
|
-
return rxjs_1.of(
|
|
52
|
+
return rxjs_1.of(webpack_1.default(c));
|
|
31
53
|
}
|
|
32
54
|
};
|
|
33
55
|
return createWebpack({ ...config, watch: false }).pipe(operators_1.switchMap((webpackCompiler) => new rxjs_1.Observable((obs) => {
|
|
@@ -76,5 +98,5 @@ function runWebpack(config, context, options = {}) {
|
|
|
76
98
|
exports.runWebpack = runWebpack;
|
|
77
99
|
exports.default = architect_1.createBuilder((options, context) => {
|
|
78
100
|
const configPath = path_1.resolve(context.workspaceRoot, options.webpackConfig);
|
|
79
|
-
return rxjs_1.from(Promise.resolve().then(() => require(configPath))).pipe(operators_1.switchMap((config) => runWebpack(config, context)));
|
|
101
|
+
return rxjs_1.from(Promise.resolve().then(() => __importStar(require(configPath)))).pipe(operators_1.switchMap(({ default: config }) => runWebpack(config, context)));
|
|
80
102
|
});
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
9
9
|
import { Observable } from 'rxjs';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import webpack from 'webpack';
|
|
11
|
+
import WebpackDevServer from 'webpack-dev-server';
|
|
12
12
|
import { BuildResult, WebpackFactory, WebpackLoggingCallback } from '../webpack';
|
|
13
13
|
import { Schema as WebpackDevServerBuilderSchema } from './schema';
|
|
14
14
|
export declare type WebpackDevServerFactory = typeof WebpackDevServer;
|
|
@@ -6,14 +6,36 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
9
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
32
|
exports.runWebpackDevServer = void 0;
|
|
11
33
|
const architect_1 = require("@angular-devkit/architect");
|
|
12
34
|
const path_1 = require("path");
|
|
13
35
|
const rxjs_1 = require("rxjs");
|
|
14
36
|
const operators_1 = require("rxjs/operators");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
37
|
+
const webpack_1 = __importDefault(require("webpack"));
|
|
38
|
+
const webpack_dev_server_1 = __importDefault(require("webpack-dev-server"));
|
|
17
39
|
const utils_1 = require("../utils");
|
|
18
40
|
function runWebpackDevServer(config, context, options = {}) {
|
|
19
41
|
const createWebpack = (c) => {
|
|
@@ -27,7 +49,7 @@ function runWebpackDevServer(config, context, options = {}) {
|
|
|
27
49
|
}
|
|
28
50
|
}
|
|
29
51
|
else {
|
|
30
|
-
return rxjs_1.of(
|
|
52
|
+
return rxjs_1.of(webpack_1.default(c));
|
|
31
53
|
}
|
|
32
54
|
};
|
|
33
55
|
const createWebpackDevServer = (webpack, config) => {
|
|
@@ -38,7 +60,7 @@ function runWebpackDevServer(config, context, options = {}) {
|
|
|
38
60
|
}
|
|
39
61
|
// webpack-dev-server types currently do not support Webpack 5
|
|
40
62
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
-
return new
|
|
63
|
+
return new webpack_dev_server_1.default(webpack, config);
|
|
42
64
|
};
|
|
43
65
|
const log = options.logging || ((stats, config) => context.logger.info(stats.toString(config.stats)));
|
|
44
66
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -90,5 +112,5 @@ function runWebpackDevServer(config, context, options = {}) {
|
|
|
90
112
|
exports.runWebpackDevServer = runWebpackDevServer;
|
|
91
113
|
exports.default = architect_1.createBuilder((options, context) => {
|
|
92
114
|
const configPath = path_1.resolve(context.workspaceRoot, options.webpackConfig);
|
|
93
|
-
return rxjs_1.from(Promise.resolve().then(() => require(configPath))).pipe(operators_1.switchMap((config) => runWebpackDevServer(config, context)));
|
|
115
|
+
return rxjs_1.from(Promise.resolve().then(() => __importStar(require(configPath)))).pipe(operators_1.switchMap(({ default: config }) => runWebpackDevServer(config, context)));
|
|
94
116
|
});
|