|
1 | 1 | var Encore = require('@symfony/webpack-encore');
|
2 | 2 |
|
3 | 3 | Encore
|
4 |
| - // the project directory where compiled assets will be stored |
| 4 | + // directory where compiled assets will be stored |
5 | 5 | .setOutputPath('public/build/')
|
6 |
| - // the public path used by the web server to access the previous directory |
| 6 | + // public path used by the web server to access the output path |
7 | 7 | .setPublicPath('/build')
|
8 |
| - // the public path you will use in Symfony's asset() function - e.g. asset('build/some_file.js') |
9 |
| - .setManifestKeyPrefix('build/') |
10 |
| - |
| 8 | + // only needed for CDN's or sub-directory deploy |
| 9 | + //.setManifestKeyPrefix('build/') |
| 10 | + |
| 11 | + /* |
| 12 | + * ENTRY CONFIG |
| 13 | + * |
| 14 | + * Add 1 entry for each "page" of your app |
| 15 | + * (including one that's included on every page - e.g. "app") |
| 16 | + * |
| 17 | + * Each entry will result in one JavaScript file (e.g. app.js) |
| 18 | + * and one CSS file (e.g. app.css) if you JavaScript imports CSS. |
| 19 | + */ |
| 20 | + .addEntry('app', './assets/js/app.js') |
| 21 | + //.addEntry('page1', './assets/js/page1.js') |
| 22 | + //.addEntry('page2', './assets/js/page2.js') |
| 23 | + |
| 24 | + /* |
| 25 | + * FEATURE CONFIG |
| 26 | + * |
| 27 | + * Enable & configure other features below. For a full |
| 28 | + * list of features, see: |
| 29 | + * https://symfony.com/doc/current/frontend.html#adding-more-features |
| 30 | + */ |
11 | 31 | .cleanupOutputBeforeBuild()
|
| 32 | + .enableBuildNotifications() |
12 | 33 | .enableSourceMaps(!Encore.isProduction())
|
13 |
| - |
14 |
| - // the following line enables hashed filenames (e.g. app.abc123.css) |
| 34 | + // enables hashed filenames (e.g. app.abc123.css) |
15 | 35 | .enableVersioning(Encore.isProduction())
|
16 | 36 |
|
17 |
| - // uncomment to define the assets of the project |
18 |
| - //.addEntry('js/app', './assets/js/app.js') |
19 |
| - //.addStyleEntry('css/app', './assets/css/app.scss') |
| 37 | + // enables Sass/SCSS support |
| 38 | + //.enableSassLoader() |
20 | 39 |
|
21 | 40 | // uncomment if you use TypeScript
|
22 | 41 | //.enableTypeScriptLoader()
|
23 | 42 |
|
24 |
| - // uncomment if you use Sass/SCSS files |
25 |
| - //.enableSassLoader() |
26 |
| - |
27 |
| - // uncomment for legacy applications that require $/jQuery as a global variable |
| 43 | + // uncomment if you're having problems with a jQuery plugin |
28 | 44 | //.autoProvidejQuery()
|
29 | 45 | ;
|
30 | 46 |
|
|
0 commit comments