Navigation Menu

Skip to content

Commit

Permalink
feat: manually port over build tool-specific changes + twig template …
Browse files Browse the repository at this point in the history
…update from #1579
  • Loading branch information
sghoweri committed Dec 4, 2019
1 parent fcabd59 commit 8e01533
Show file tree
Hide file tree
Showing 19 changed files with 353 additions and 215 deletions.
2 changes: 2 additions & 0 deletions .boltrc.js
Expand Up @@ -67,6 +67,8 @@ nonImageFixtures.forEach(fixturePath => {
});

module.exports = {
// @todo: uncomment once related ES Module updates are in place
// esModules: true,
wwwDir: adjustRelativePath(siteConfig.wwwDir),
buildDir: adjustRelativePath(siteConfig.buildDir),
iconDir: [],
Expand Down
2 changes: 2 additions & 0 deletions docs-site/.boltrc.js
Expand Up @@ -11,6 +11,8 @@ const config = {
openServerAtStart: true,
// Environmental variable / preset to use
env: 'pwa',
// @todo: uncomment once related ES Module updates are in place
// esModules: true,
srcDir: './src/pages',
buildDir: '../www/build',
dataDir: '../www/build/data',
Expand Down
22 changes: 17 additions & 5 deletions docs-site/src/templates/_site-footer.twig
Expand Up @@ -5,14 +5,26 @@
{% endif %}

{# @TODO: how do we get this to use the exact same values from our global .js config without having the source of truth live as a .yml or .json file...? #}
{% set manifestConfigFile = "@bolt-assets/bolt-webpack-manifest#{lang != "" ? "-" ~ lang : ""}.json" %}
{% set legacyManifestConfig = "@bolt-assets/bolt-webpack-manifest#{lang != "" ? "-" ~ lang : ""}.json" %}
{% set modernManifestConfig = "@bolt-assets/bolt-webpack-manifest#{lang != "" ? "-" ~ lang : ""}.modern.json" %}

{% set assets = [] %}
{% if fileExists(manifestConfigFile) %}
{% set assets = get_data(manifestConfigFile) %}
{% set legacyAssets = [] %}
{% set modernAssets = [] %}

{% if fileExists(legacyManifestConfig) %}
{% set legacyAssets = get_data(legacyManifestConfig) %}
{% endif %}

{% if fileExists(modernManifestConfig) %}
{% set modernAssets = get_data(modernManifestConfig) %}
{% endif %}

<script src="{{ assets["bolt-global.js"] | default("/build/bolt-global.js") }}?cacheBuster={{ cacheBuster }}" async></script>
{% if bolt.data.config.esModules %}
<script type="module" src="{{ modernAssets["bolt-global.js"] | default("/build/bolt-global.modern.js") }}?cacheBuster={{ cacheBuster }}"></script>
<script nomodule src="{{ legacyAssets["bolt-global.js"] | default("/build/bolt-global.js") }}?cacheBuster={{ cacheBuster }}" async></script>
{% else %}
<script src="{{ legacyAssets["bolt-global.js"] | default("/build/bolt-global.js") }}?cacheBuster={{ cacheBuster }}" async></script>
{% endif %}

{{ patternLabFoot | raw }}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -79,7 +79,7 @@
"test:monorepo": "jest ./__tests__/monorepo -c jest.config.quick.js --noStackTrace",
"test:build-tools": "cd packages/build-tools && yarn run test",
"test:php": "cd packages/core-php -- composer run test",
"test:pkgs": "lerna run test --ignore=@bolt/uikit-* --ignore=@bolt/build-tools--*",
"test:pkgs": "lerna run test --ignore=@bolt/uikit-* --ignore=@bolt/build-tools--* --stream",
"test:types": "tsc",
"postinstall": "patch-package && npx lerna run postbootstrap",
"release": "node ./auto-release.js"
Expand Down

0 comments on commit 8e01533

Please sign in to comment.