Revised webpack bundling and updated worker loading, turned inline worker on by default.

This commit is contained in:
Taloth Saldono 2020-06-06 23:03:15 +02:00
parent 6b7566fed8
commit 224fe32b72
5 changed files with 8 additions and 16 deletions

View File

@ -10,8 +10,7 @@ gulp.task('build',
'webpack',
'copyHtml',
'copyFonts',
'copyImages',
'copyJs'
'copyImages'
)
)
);

View File

@ -5,17 +5,6 @@ const cache = require('gulp-cached');
const livereload = require('gulp-livereload');
const paths = require('./helpers/paths.js');
gulp.task('copyJs', () => {
return gulp.src(
[
path.join(paths.src.root, 'polyfills.js')
], { base: paths.src.root })
.pipe(cache('copyJs'))
.pipe(print())
.pipe(gulp.dest(paths.dest.root))
.pipe(livereload());
});
gulp.task('copyHtml', () => {
return gulp.src(paths.src.html, { base: paths.src.root })
.pipe(cache('copyHtml'))

View File

@ -13,6 +13,7 @@ const frontendFolder = path.join(__dirname, '..');
const srcFolder = path.join(frontendFolder, 'src');
const isProduction = process.argv.indexOf('--production') > -1;
const isProfiling = isProduction && process.argv.indexOf('--profile') > -1;
const inlineWebWorkers = true;
const distFolder = path.resolve(frontendFolder, '..', '_output', uiFolder);
@ -121,7 +122,9 @@ const config = {
use: {
loader: 'worker-loader',
options: {
name: '[name].js'
name: '[name].js',
inline: inlineWebWorkers,
fallback: !inlineWebWorkers
}
}
},

View File

@ -79,6 +79,5 @@
</body>
<script src="/initialize.js" data-no-hash></script>
<script src="/polyfills.js"></script>
<!-- webpack bundles body -->
</html>

View File

@ -1,4 +1,6 @@
import './preload.js';
import './preload';
import './polyfills';
import React from 'react';
import { render } from 'react-dom';
import { createBrowserHistory } from 'history';