1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-26 22:52:40 +02:00

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 committed by Qstick
parent 9c3b4e3025
commit 3e3b2a7784
5 changed files with 8 additions and 16 deletions

View File

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

View File

@ -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'))

View File

@ -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
} }
} }
}, },

View File

@ -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>

View File

@ -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';