webpack-bootstrap-ui-kit/src/js/test-build.js

68 lines
2.0 KiB
JavaScript
Raw Normal View History

2021-09-13 00:29:26 +02:00
'use strict';
2021-08-09 15:10:08 +02:00
2021-09-13 00:29:26 +02:00
import '../scss/test-build.scss';
import '@a2nt/meta-lightbox-js/src/js/test-build';
2021-08-09 15:10:08 +02:00
2021-09-13 00:29:26 +02:00
import Events from './_events';
import MainUI from './main';
2021-08-09 15:10:08 +02:00
/*
* AJAX functionality
*/
2021-09-13 00:29:26 +02:00
//import "./ajax/links";
import './ajax/online';
import './ajax/lazy-images';
2021-08-09 15:10:08 +02:00
2021-09-13 00:29:26 +02:00
import './layout';
2021-08-09 15:10:08 +02:00
2021-09-13 00:29:26 +02:00
import './store';
2021-08-10 01:27:05 +02:00
/*if (process.env.NODEENV === 'development') {
// mocking service worker
const regeneratorRuntime = require('regenerator-runtime');
const {
worker,
} = require('../mocks/browser');
worker.start({
serviceWorker: {
url: 'graphql/mockServiceWorker.js',
options: {
scope: '/',
},
},
});
}*/
// caching service worker (set injectClient: false at webpack.config.serve.js)
/*if (process.env.NODEENV === 'development') {if ('serviceWorker' in navigator) {
const baseHref = (document.getElementsByTagName('base')[0] || {}).href;
const version = (document.querySelector('meta[name="swversion"]') || {})
.content;
if (baseHref) {
navigator.serviceWorker
.register(`${baseHref}appsw.js?v=${version}`)
.then(() => {
console.log('SW: Registered');
});
}
}}*/
2021-08-09 15:10:08 +02:00
function importAll(r) {
return r.keys().map(r);
}
const images = importAll(
2021-09-13 00:29:26 +02:00
require.context('../img/', false, /\.(png|jpe?g|svg)$/)
2021-08-09 15:10:08 +02:00
);
const fontAwesome = importAll(
2021-09-13 00:29:26 +02:00
require.context('font-awesome', false, /\.(otf|eot|svg|ttf|woff|woff2)$/)
2021-08-09 15:10:08 +02:00
);
2021-08-11 19:17:10 +02:00
if (module.hot) {
2021-09-13 00:29:26 +02:00
module.hot.accept('app.js', () => {
console.log('Accepting the updated printMe module!');
2021-08-18 20:51:15 +02:00
});
2021-09-13 00:29:26 +02:00
module.hot.accept('app.scss', () => {
console.log('Accepting the updated printMe module!');
2021-08-18 20:51:15 +02:00
});
2021-08-11 19:17:10 +02:00
}