Skip to content

Commit 1d49c5d

Browse files
authored
Merge pull request #1330 from stof/add_internal_types
Add some types in the internal implementation of Encore
2 parents 1a5e2f8 + 12c8144 commit 1d49c5d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/config-generator.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class ConfigGenerator {
8282
this.webpackConfig.runtimeConfig.devServerFinalIsHttps = false;
8383
}
8484

85+
/**
86+
* @type {import('webpack').Configuration}
87+
*/
8588
const config = {
8689
context: this.webpackConfig.getContext(),
8790
entry: this.buildEntryConfig(),
@@ -158,6 +161,9 @@ class ConfigGenerator {
158161
}
159162

160163
buildEntryConfig() {
164+
/**
165+
* @type {Record<string, string[]>}
166+
*/
161167
const entry = {};
162168

163169
for (const [entryName, entryChunks] of this.webpackConfig.entries) {
@@ -544,7 +550,7 @@ class ConfigGenerator {
544550
}
545551

546552
if (this.webpackConfig.shouldUseSingleRuntimeChunk) {
547-
optimization.runtimeChunk = 'single';
553+
optimization.runtimeChunk = /** @type {const} */ ('single');
548554
}
549555

550556
optimization.splitChunks = applyOptionsCallback(
@@ -558,7 +564,7 @@ class ConfigGenerator {
558564
buildCacheConfig() {
559565
const cache = {};
560566

561-
cache.type = 'filesystem';
567+
cache.type = /** @type {const} */ ('filesystem');
562568
cache.buildDependencies = this.webpackConfig.persistentCacheBuildDependencies;
563569

564570
applyOptionsCallback(

lib/loaders/css.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ module.exports = {
2525
getLoaders(webpackConfig, useCssModules = false) {
2626
const usePostCssLoader = webpackConfig.usePostCssLoader;
2727

28+
/**
29+
* @type {boolean|object}
30+
*/
2831
let modulesConfig = false;
2932
if (useCssModules) {
3033
modulesConfig = {

0 commit comments

Comments
 (0)