Multiple frontend support (#110)
* Initial multiple frontend support * Removed unnecessary require() * Moved styles/images out of commonmain
parent
6ff084dbbb
commit
b61e3daf98
@ -1,9 +1,6 @@
|
|||||||
import { start } from 'rails-ujs';
|
import { start } from 'rails-ujs';
|
||||||
|
|
||||||
// import default stylesheet with variables
|
// import common styling
|
||||||
require('font-awesome/css/font-awesome.css');
|
require('../styles/common.scss');
|
||||||
require('mastodon-application-style');
|
|
||||||
|
|
||||||
require.context('../images/', true);
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
// This file replaces `app/javascript/packs/application.js` for use
|
||||||
|
// with multiple frontends.
|
||||||
|
|
||||||
|
import loadPolyfills from '../../mastodon/load_polyfills';
|
||||||
|
|
||||||
|
// import default stylesheet with variables
|
||||||
|
require('font-awesome/css/font-awesome.css');
|
||||||
|
require('mastodon-application-style');
|
||||||
|
|
||||||
|
require.context('../../images/', true);
|
||||||
|
|
||||||
|
loadPolyfills().then(() => {
|
||||||
|
require('../../mastodon/main').default();
|
||||||
|
}).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
// This makes our fonts available everywhere.
|
||||||
|
|
||||||
|
@import 'fonts/roboto';
|
||||||
|
@import 'fonts/roboto-mono';
|
||||||
|
@import 'fonts/montserrat';
|
@ -0,0 +1,7 @@
|
|||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
Rails.application.configure do
|
||||||
|
frontends = []
|
||||||
|
Rails.root.join('app', 'javascript', 'packs', 'frontends').each_child(false) { |f| frontends.push f.to_s }
|
||||||
|
config.x.available_frontends = frontends
|
||||||
|
end
|
Loading…
Reference in new issue