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

pull/3801/head
Taloth Saldono 4 years ago
parent 6b7566fed8
commit 224fe32b72

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

@ -5,17 +5,6 @@ const cache = require('gulp-cached');
const livereload = require('gulp-livereload'); const livereload = require('gulp-livereload');
const paths = require('./helpers/paths.js'); 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', () => { gulp.task('copyHtml', () => {
return gulp.src(paths.src.html, { base: paths.src.root }) return gulp.src(paths.src.html, { base: paths.src.root })
.pipe(cache('copyHtml')) .pipe(cache('copyHtml'))

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

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

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

Loading…
Cancel
Save