File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ Guides
6161* :doc: `Adding custom loaders </frontend/encore/custom-loaders >`
6262* :doc: `Advanced Webpack Configuration </frontend/encore/advanced-config >`
6363
64+ Troubleshooting
65+ ...............
66+
67+ * :doc: `FAQ </frontend/encore/faq >`
68+
6469Full API
6570........
6671
Original file line number Diff line number Diff line change 1+ Frequently Asked Questions
2+ ==========================
3+
4+ My App Lives under a Subdirectory
5+ ---------------------------------
6+
7+ My app doesn't live at the root of my web server: it lives under a subdirectory
8+ (e.g. ``/myAppSubdir/ ``). How can I configure Encore to work?
9+
10+ If your app lives under a subdirectory, you just need to include that when calling
11+ ``Encore.setPublicPrefix() ``:
12+
13+ .. code-block :: diff
14+
15+ // webpack.config.js
16+ Encore
17+ // ...
18+
19+ .setOutputPath('web/build/')
20+
21+ - .setPublicPath('/build')
22+ + // this is your *true* public path
23+ + .setPublicPath('/myAppSubdir/build')
24+
25+ + // this is now needed so that your manifest.json keys are still `build/foo.js`
26+ + // i.e. you won't need to change anything in your Symfony app
27+ + config.setManifestKeyPrefix('build')
28+ ;
29+
30+ If you're :ref: `processing your assets through manifest.json <load-manifest-files >`,
31+ you're done! The ``manifest.json `` file will now include the subdirectory in the
32+ final paths:
33+
34+ .. code-block :: json
35+
36+ {
37+ "build/app.js" : " /myAppSubdir/build/app.123abc.js" ,
38+ "build/dashboard.css" : " /myAppSubdir/build/dashboard.a4bf2d.css"
39+ }
You can’t perform that action at this time.
0 commit comments