1 | <?php |
||
2 | /** |
||
3 | * Twigpack plugin for Craft CMS 3.x |
||
4 | * |
||
5 | * Twigpack is the conduit between Twig and webpack, with manifest.json & |
||
6 | * webpack-dev-server HMR support |
||
7 | * |
||
8 | * @link https://nystudio107.com/ |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
9 | * @copyright Copyright (c) 2018 nystudio107 |
||
0 ignored issues
–
show
|
|||
10 | */ |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | /** |
||
13 | * Twigpack config.php |
||
14 | * |
||
15 | * This file exists only as a template for the Twigpack settings. |
||
16 | * It does nothing on its own. |
||
17 | * |
||
18 | * Don't edit this file, instead copy it to 'craft/config' as 'twigpack.php' |
||
19 | * and make your changes there to override default settings. |
||
20 | * |
||
21 | * Once copied to 'craft/config', this file will be multi-environment aware as |
||
22 | * well, so you can have different settings groups for each environment, just as |
||
23 | * you do for 'general.php' |
||
24 | */ |
||
25 | |||
26 | return [ |
||
27 | // Global settings |
||
28 | '*' => [ |
||
29 | // If `devMode` is on, use webpack-dev-server to all for HMR (hot module reloading) |
||
30 | 'useDevServer' => false, |
||
31 | // Enforce Absolute URLs on includes |
||
32 | 'useAbsoluteUrl' => true, |
||
33 | // The JavaScript entry from the manifest.json to inject on Twig error pages |
||
34 | // This can be a string or an array of strings |
||
35 | 'errorEntry' => '', |
||
36 | // String to be appended to the cache key |
||
37 | 'cacheKeySuffix' => '', |
||
38 | // Manifest file names |
||
39 | 'manifest' => [ |
||
40 | 'legacy' => 'manifest-legacy.json', |
||
41 | 'modern' => 'manifest.json', |
||
42 | ], |
||
43 | // Public server config |
||
44 | 'server' => [ |
||
45 | 'manifestPath' => '@webroot/', |
||
46 | 'publicPath' => '/', |
||
47 | ], |
||
48 | // webpack-dev-server config |
||
49 | 'devServer' => [ |
||
50 | 'manifestPath' => 'http://localhost:8080/', |
||
51 | 'publicPath' => 'http://localhost:8080/', |
||
52 | ], |
||
53 | // Bundle to use with the webpack-dev-server |
||
54 | 'devServerBuildType' => 'modern', |
||
55 | // Whether to include a Content Security Policy "nonce" for inline |
||
56 | // CSS or JavaScript. Valid values are 'header' or 'tag' for how the CSP |
||
57 | // should be included. c.f.: |
||
58 | // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#Unsafe_inline_script |
||
59 | 'cspNonce' => '', |
||
60 | // Local files config |
||
61 | 'localFiles' => [ |
||
62 | 'basePath' => '@webroot/', |
||
63 | 'criticalPrefix' => 'dist/criticalcss/', |
||
64 | 'criticalSuffix' => '_critical.min.css', |
||
65 | ], |
||
66 | ], |
||
67 | // Live (production) environment |
||
68 | 'live' => [ |
||
69 | ], |
||
70 | // Staging (pre-production) environment |
||
71 | 'staging' => [ |
||
72 | ], |
||
73 | // Development environment |
||
74 | 'dev' => [ |
||
75 | // If `devMode` is on, use webpack-dev-server to all for HMR (hot module reloading) |
||
76 | 'useDevServer' => true, |
||
77 | ], |
||
78 | ]; |
||
79 |