@@ -52,20 +52,20 @@ a(id="entries-outputs")
5252 We feed Webpack with one or more *entry* files and let it find and incorporate the dependencies that radiate from those entries.
5353 In this example, we start from the application's root file, `src/app.ts`:
5454
55- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'one-entry' , 'webpack.config.js (single entry)' )( format ="." )
55+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'one-entry' , 'webpack.config.js (single entry)' )( format ="." )
5656
5757:marked
5858 Webpack inspects that file and traverses its `import` dependencies recursively.
5959
60- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'app-example' , 'src/app.ts' )( format ="." )
60+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'app-example' , 'src/app.ts' )( format ="." )
6161
6262:marked
6363 Here it sees that we're importing *@angular/core* so it adds that to its dependency list for (potential) inclusion in the bundle.
6464 It opens *@angular/core* and follows _its_ network of `import` statements until it has build the complete dependency graph from `app.ts` down.
6565
6666 Then it **outputs** these files to the `app.js` _bundle file_ designated in configuration:
6767
68- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'one-output' , 'webpack.config.js (single output)' )( format ="." )
68+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'one-output' , 'webpack.config.js (single output)' )( format ="." )
6969
7070:marked
7171 This `app.js` output bundle is a single JavaScript file that contains our application source and its dependencies.
@@ -77,7 +77,7 @@ a(id="entries-outputs")
7777
7878 We change the configuration so that we have two entry points, `app.ts` and `vendor.ts`:
7979
80- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'two-entries' ,'webpack.config.js (two entries)' )( format ="." )
80+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'two-entries' ,'webpack.config.js (two entries)' )( format ="." )
8181:marked
8282 Webpack constructs two separate dependency graphs
8383 and emits *two* bundle files, one called `app.js` containing only our application code and
@@ -105,12 +105,12 @@ a(id="loaders")
105105 We teach it to process such files into JavaScript with *loaders*.
106106 Here we configure loaders for TypeScript and CSS:
107107
108- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'loaders' , 'webpack.config.js (two entries)' )( format ="." )
108+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'loaders' , 'webpack.config.js (two entries)' )( format ="." )
109109
110110:marked
111111 As Webpack encounters `import` statements like these ...
112112
113- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'imports' )( format ="." )
113+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'imports' )( format ="." )
114114
115115:marked
116116 ... it applies the `test` RegEx patterns. When a pattern matches the filename, Webpack processes the file with the associated loader.
@@ -131,7 +131,7 @@ a(id="plugins")
131131 Webpack has a build pipeline with well-defined phases.
132132 We tap into that pipeline with plugins such as the `uglify` minification plugin:
133133
134- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'plugins' )( format ="." )
134+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'plugins' )( format ="." )
135135
136136a( id ="configure-webpack" )
137137.l-main-section
@@ -212,7 +212,7 @@ a(id="common-configuration")
212212:marked
213213 Our app will `import` dozens if not hundreds of JavaScript and TypeScript files.
214214 We _might_ write `import` statements with explicit extensions as in this example:
215- + makeExample('webpack/ts-snippets/webpack.config.snippets.js ' , 'single-import' )( format ="." )
215+ + makeExample('webpack/ts-snippets/webpack.config.snippets.ts ' , 'single-import' )( format ="." )
216216
217217:marked
218218 But most of our `import` statements won't mention the extension at all.
0 commit comments