You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: doc/article/en-US/bundling-your-app-for-deploy.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,9 @@ Now, let's create a `bundle.js` file in `build/tasks/bundle.js` as follows:
55
55
baseURL: '.', // baseURL of the application
56
56
configPath: './config.js', // config.js file. Must be within `baseURL`
57
57
bundles: {
58
-
"dist/app-build": {
58
+
"dist/app-build": { // bundle name/path. Must be within `baseURL`. Final path is: `baseURL/dist/app-build.js`.
59
59
includes: [
60
-
'[*]',
60
+
'[*.js]',
61
61
'*.html!text',
62
62
'*.css!text',
63
63
],
@@ -147,14 +147,14 @@ Let us now take a closer look at the `config` object. We will skip `force` and `
147
147
bundles: {
148
148
"dist/app-build": {
149
149
includes: [
150
-
'[*]',
150
+
'[*.js]',
151
151
'*.html!text',
152
152
'*.css!text',
153
153
],
154
154
</source-code>
155
155
</code-listing>
156
156
157
-
Please pay attention to the pattern `[*]`. The bundler supports some glob patterns like `*`, `*/**` etc. `*` here means, we are interested in bundling all the `js` assets in the `dist` folder (considering the `path` in `config.js`). So what does `[*]` mean here? Well, as we know, the bundler will trace the module dependencies from the import statements. Lot's of our code refers to the modules of `Aurelia` via `import` statements. For example:
157
+
Please pay attention to the pattern `[*.js]`. The bundler supports some glob patterns like `*.js`, `*/**/*.js` etc. `*.js` here means, we are interested in bundling all the `js` assets in the `dist` folder (considering the `path` in `config.js`). So what does `[*.js]` mean here? Well, as we know, the bundler will trace the module dependencies from the import statements. Lot's of our code refers to the modules of `Aurelia` via `import` statements. For example:
158
158
159
159
<code-listingheading="users.js">
160
160
<source-codelang="JavaScript">
@@ -193,18 +193,18 @@ When the bundler analyzes this file it will find `aurelia-framework` and `aureli
193
193
bundles: {
194
194
"dist/app-build": {
195
195
includes: [
196
-
'*',
196
+
'*.js',
197
197
'*.html!text',
198
198
'*.css!text',
199
199
],
200
200
</source-code>
201
201
</code-listing>
202
202
203
-
Having `*` in the above config will create a bundle containing lots of `Aurelia` libraries including `aurelia-framework` and `aurelia-fetch-client`. If we consider the second bundle config `dist/vendor-build`, we have 'aurelia-bootstrapper' and 'aurelia-fetch-client'. `aurelia-bootstrapper` will yield `aurelia-framework`. Ultimately, we will end up with duplicate modules in both the bundles.
203
+
Having `*.js` in the above config will create a bundle containing lots of `Aurelia` libraries including `aurelia-framework` and `aurelia-fetch-client`. If we consider the second bundle config `dist/vendor-build`, we have 'aurelia-bootstrapper' and 'aurelia-fetch-client'. `aurelia-bootstrapper` will yield `aurelia-framework`. Ultimately, we will end up with duplicate modules in both the bundles.
204
204
205
-
Our goal is to create a bundle of our application code only. We have to somehow instruct the bundler not to recursively trace the dependencies. Guess what? `[*]` is how we do it.
205
+
Our goal is to create a bundle of our application code only. We have to somehow instruct the bundler not to recursively trace the dependencies. Guess what? `[*.js]` is how we do it.
206
206
207
-
`[*]` will exclude the dependencies of each module that the glob pattern `*` yields. In the above case it will exclude `aurelia-framework`, `aurelia-fetch-client` and so on.
207
+
`[*.js]` will exclude the dependencies of each module that the glob pattern `*.js` yields. In the above case it will exclude `aurelia-framework`, `aurelia-fetch-client` and so on.
0 commit comments