Skip to content

Commit

Permalink
Merge pull request #2035 from tf/widget-packs
Browse files Browse the repository at this point in the history
Decouple host application from scrolled widget packs
  • Loading branch information
tf authored Dec 11, 2023
2 parents 354f049 + 631a636 commit fcfed93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,7 @@ def server_pack
create_file 'app/javascript/packs/pageflow-scrolled-server.js', <<-JS
import 'pageflow-scrolled/frontend-server';
import 'pageflow-scrolled/contentElements-frontend';
import 'pageflow-scrolled/widgets/defaultNavigation';
import 'pageflow-scrolled/widgets/consentBar';
JS
end

def default_navigation_widget_packs
widget_dir = 'app/javascript/packs/pageflow-scrolled/widgets'

create_file File.join(widget_dir, 'defaultNavigation.js'), <<-JS
import 'pageflow-scrolled/widgets/defaultNavigation';
import 'pageflow-scrolled/widgets/defaultNavigation.css';
JS
end

def consent_bar_widget_packs
widget_dir = 'app/javascript/packs/pageflow-scrolled/widgets'

create_file File.join(widget_dir, 'consentBar.js'), <<-JS
import 'pageflow-scrolled/widgets/consentBar';
import 'pageflow-scrolled/widgets/consentBar.css';
import 'pageflow-scrolled/widgets-server';
JS
end

Expand Down
14 changes: 14 additions & 0 deletions entry_types/scrolled/package/config/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,19 @@ module.exports = {
// supported by the browser.
'video.js$': 'video.js/core.es.js'
},
},
entry: {
'pageflow-scrolled/widgets/defaultNavigation': {
import: [
'pageflow-scrolled/widgets/defaultNavigation',
'pageflow-scrolled/widgets/defaultNavigation.css'
]
},
'pageflow-scrolled/widgets/consentBar': {
import: [
'pageflow-scrolled/widgets/consentBar',
'pageflow-scrolled/widgets/consentBar.css'
]
}
}
};
2 changes: 2 additions & 0 deletions entry_types/scrolled/package/widgets-server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import 'pageflow-scrolled/widgets/defaultNavigation';
import 'pageflow-scrolled/widgets/consentBar';

0 comments on commit fcfed93

Please sign in to comment.