Skip to content

Commit

Permalink
Merge pull request #130 from StrykeSlammerII/patch-3
Browse files Browse the repository at this point in the history
Show "path.resolve" usage
  • Loading branch information
lcharette authored Feb 11, 2024
2 parents 894c4d6 + 7d50cd7 commit cfb7f89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pages/13.asset-management/03.asset-bundles/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ Now that the "entry" files have been created, we need to register them with Enco

**webpack.entries.js**
```js
const path = require('path');
module.exports = {
'main': "./app/assets/main.js",
'page.checkout': "./app/assets/checkout.js",
'page.account': "./app/assets/account.js",
'main': path.resolve(__dirname), './app/assets/main.js',
'page.checkout': path.resolve(__dirname), './app/assets/checkout.js',
'page.account': path.resolve(__dirname), './app/assets/account.js',
};
```

This tells Encore to load the `assets/assets/main.js` file (for example) and follow all of the `require()` statements. It will then package everything together and - thanks to the first `main` argument - output final `public/assets/main.js` and `public/assets/main.css` files.
This tells Encore to load the `app/assets/main.js` file (for example) and follow all of the `require()` statements. It will then package everything together and - thanks to the first `main` argument - output final `public/assets/main.js` and `public/assets/main.css` files.

Sprinkle's overriding properties also applies to the entries themselves. In other words, naming an entry `page.account` in your own sprinkle will replace the one defined in the `account` sprinkle with yours, for example. In the process, it will probably break core user management functionality. In general, be careful to provide your entries with a unique name to avoid difficult to diagnose runtime errors.

Expand Down

0 comments on commit cfb7f89

Please sign in to comment.