Skip to content

Commit a11e9da

Browse files
Merge branch 'master' of https://github.com/ahmedshuhel/framework into ahmedshuhel-master
2 parents 400ccc0 + 1bb9e69 commit a11e9da

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

doc/article/en-US/bundling-your-app-for-deploy.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ Now, let's create a `bundle.js` file in `build/tasks/bundle.js` as follows:
5555
baseURL: '.', // baseURL of the application
5656
configPath: './config.js', // config.js file. Must be within `baseURL`
5757
bundles: {
58-
"dist/app-build": {
58+
"dist/app-build": { // bundle name/path. Must be within `baseURL`. Final path is: `baseURL/dist/app-build.js`.
5959
includes: [
60-
'[*]',
60+
'[*.js]',
6161
'*.html!text',
6262
'*.css!text',
6363
],
@@ -147,14 +147,14 @@ Let us now take a closer look at the `config` object. We will skip `force` and `
147147
bundles: {
148148
"dist/app-build": {
149149
includes: [
150-
'[*]',
150+
'[*.js]',
151151
'*.html!text',
152152
'*.css!text',
153153
],
154154
</source-code>
155155
</code-listing>
156156

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:
158158

159159
<code-listing heading="users.js">
160160
<source-code lang="JavaScript">
@@ -193,18 +193,18 @@ When the bundler analyzes this file it will find `aurelia-framework` and `aureli
193193
bundles: {
194194
"dist/app-build": {
195195
includes: [
196-
'*',
196+
'*.js',
197197
'*.html!text',
198198
'*.css!text',
199199
],
200200
</source-code>
201201
</code-listing>
202202

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.
204204

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.
206206

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.
208208

209209
## [Bundle Configuration](aurelia-doc://section/6/version/1.0.0)
210210

@@ -214,7 +214,7 @@ Here is a typical bundle configuration in all its glory:
214214
<source-code lang="JavaScript">
215215
"dist/app-build": {
216216
includes: [
217-
'[*]',
217+
'[*.js]',
218218
'*.html!text',
219219
'*.css!text',
220220
'bootstrap/css/bootstrap.css!text'
@@ -314,7 +314,7 @@ We will also change the first bundle a little bit to exclude all the `html` and
314314
bundles: {
315315
"dist/app-build": {
316316
includes: [
317-
'[*]'
317+
'[*.js]'
318318
],
319319
options: {
320320
inject: true,

0 commit comments

Comments
 (0)