Skip to content

Commit 18dc9b4

Browse files
authored
templates: add type hints (#4493)
1 parent 7e677a0 commit 18dc9b4

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

packages/create-webpack-app/templates/init/default/webpack.config.js.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const stylesHandler = 'style-loader';
1616
<% } %>
1717
<% } %>
1818

19+
/** @type {import("webpack").Configuration} */
1920
const config = {
2021
entry: '<%= entryPoint %>',
2122
output: {

packages/create-webpack-app/templates/init/react/webpack.config.js.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const stylesHandler = 'style-loader';
1616
<% } %>
1717
<% } %>
1818

19+
/** @type {import("webpack").Configuration} */
1920
const config = {
2021
entry: '<%= entry %>',
2122
output: {

packages/create-webpack-app/templates/init/svelte/webpack.config.js.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const stylesHandler = 'style-loader';
1616
<% } %>
1717
<% } %>
1818

19+
/** @type {import("webpack").Configuration} */
1920
const config = {
2021
entry: '<%= entry %>',
2122
output: {

packages/create-webpack-app/templates/init/vue/webpack.config.js.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const stylesHandler = 'vue-style-loader';
1717
<% } %>
1818
<% } %>
1919

20+
/** @type {import("webpack").Configuration} */
2021
const config = {
2122
entry: '<%= entry %>',
2223
output: {

test/create-webpack-app/init/__snapshots__/init.test.js.snap.webpack5

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const path = require('path');
9393
const isProduction = process.env.NODE_ENV === 'production';
9494

9595

96+
/** @type {import("webpack").Configuration} */
9697
const config = {
9798
entry: './src/index.js',
9899
output: {
@@ -165,6 +166,7 @@ const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
165166
const isProduction = process.env.NODE_ENV === 'production';
166167

167168

169+
/** @type {import("webpack").Configuration} */
168170
const config = {
169171
entry: './src/index.js',
170172
output: {
@@ -243,6 +245,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
243245
const isProduction = process.env.NODE_ENV === 'production';
244246

245247

248+
/** @type {import("webpack").Configuration} */
246249
const config = {
247250
entry: './src/index.js',
248251
output: {
@@ -317,6 +320,7 @@ const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
317320
const isProduction = process.env.NODE_ENV === 'production';
318321

319322

323+
/** @type {import("webpack").Configuration} */
320324
const config = {
321325
entry: './src/index.js',
322326
output: {
@@ -391,6 +395,7 @@ const path = require('path');
391395
const isProduction = process.env.NODE_ENV === 'production';
392396

393397

398+
/** @type {import("webpack").Configuration} */
394399
const config = {
395400
entry: './src/index.js',
396401
output: {
@@ -542,6 +547,7 @@ const stylesHandler = 'style-loader';
542547

543548

544549

550+
/** @type {import("webpack").Configuration} */
545551
const config = {
546552
entry: './src/index.jsx',
547553
output: {
@@ -657,6 +663,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
657663

658664

659665

666+
/** @type {import("webpack").Configuration} */
660667
const config = {
661668
entry: './src/index.jsx',
662669
output: {
@@ -766,6 +773,7 @@ const stylesHandler = 'style-loader';
766773

767774

768775

776+
/** @type {import("webpack").Configuration} */
769777
const config = {
770778
entry: './src/main.js',
771779
output: {
@@ -889,6 +897,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
889897

890898

891899

900+
/** @type {import("webpack").Configuration} */
892901
const config = {
893902
entry: './src/main.js',
894903
output: {
@@ -994,6 +1003,7 @@ const path = require('path');
9941003
const isProduction = process.env.NODE_ENV === 'production';
9951004

9961005

1006+
/** @type {import("webpack").Configuration} */
9971007
const config = {
9981008
entry: './src/index.ts',
9991009
output: {
@@ -1085,6 +1095,7 @@ const stylesHandler = 'vue-style-loader';
10851095

10861096

10871097

1098+
/** @type {import("webpack").Configuration} */
10881099
const config = {
10891100
entry: './src/main.js',
10901101
output: {
@@ -1206,6 +1217,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'vue-style-lo
12061217

12071218

12081219

1220+
/** @type {import("webpack").Configuration} */
12091221
const config = {
12101222
entry: './src/main.js',
12111223
output: {
@@ -1312,6 +1324,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
13121324

13131325

13141326

1327+
/** @type {import("webpack").Configuration} */
13151328
const config = {
13161329
entry: './src/index.js',
13171330
output: {
@@ -1389,6 +1402,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
13891402

13901403

13911404

1405+
/** @type {import("webpack").Configuration} */
13921406
const config = {
13931407
entry: './src/index.js',
13941408
output: {
@@ -1467,6 +1481,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
14671481

14681482

14691483

1484+
/** @type {import("webpack").Configuration} */
14701485
const config = {
14711486
entry: './src/index.js',
14721487
output: {
@@ -1547,6 +1562,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
15471562

15481563

15491564

1565+
/** @type {import("webpack").Configuration} */
15501566
const config = {
15511567
entry: './src/index.js',
15521568
output: {
@@ -1628,6 +1644,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
16281644

16291645

16301646

1647+
/** @type {import("webpack").Configuration} */
16311648
const config = {
16321649
entry: './src/index.js',
16331650
output: {
@@ -1708,6 +1725,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
17081725

17091726

17101727

1728+
/** @type {import("webpack").Configuration} */
17111729
const config = {
17121730
entry: './src/index.js',
17131731
output: {
@@ -1785,6 +1803,7 @@ const stylesHandler = isProduction ? MiniCssExtractPlugin.loader : 'style-loader
17851803

17861804

17871805

1806+
/** @type {import("webpack").Configuration} */
17881807
const config = {
17891808
entry: './src/index.js',
17901809
output: {

0 commit comments

Comments
 (0)