THREE.js doesn't like the timestamp name,
cause every language bundle builds its own three.js change order of script insertion (vendor before client)
This commit is contained in:
parent
d2fa61f3c6
commit
6b0404b66d
|
@ -34,7 +34,7 @@ function checkAssets() {
|
|||
const parts = filename.split('.');
|
||||
|
||||
// File needs to have a timestamp in its name
|
||||
if (parts.length < 3 || Number.isNaN(Number(parts[parts.length - 2]))) {
|
||||
if (parts.length < 3) {
|
||||
continue;
|
||||
}
|
||||
// if multiple candidates exist, take most recent created file
|
||||
|
@ -81,12 +81,6 @@ assets = checkAssets();
|
|||
|
||||
export function getJsAssets(name, lang) {
|
||||
const jsAssets = [];
|
||||
const mainAsset = (lang && assets.js[name][lang])
|
||||
|| assets.js[name].default
|
||||
|| assets.js[name];
|
||||
if (mainAsset) {
|
||||
jsAssets.push(mainAsset);
|
||||
}
|
||||
|
||||
switch (name) {
|
||||
case 'client':
|
||||
|
@ -98,6 +92,14 @@ export function getJsAssets(name, lang) {
|
|||
default:
|
||||
// nothing
|
||||
}
|
||||
|
||||
const mainAsset = (lang && assets.js[name][lang])
|
||||
|| assets.js[name].default
|
||||
|| assets.js[name];
|
||||
if (mainAsset) {
|
||||
jsAssets.push(mainAsset);
|
||||
}
|
||||
|
||||
return jsAssets;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,11 +13,6 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|||
*/
|
||||
process.chdir(__dirname);
|
||||
|
||||
/*
|
||||
* timestamp for filenames
|
||||
*/
|
||||
const buildTs = Date.now();
|
||||
|
||||
function buildWebpackClientConfig(
|
||||
development,
|
||||
analyze,
|
||||
|
@ -68,9 +63,9 @@ function buildWebpackClientConfig(
|
|||
|
||||
output: {
|
||||
path: path.resolve('dist', 'public', 'assets'),
|
||||
// publicPath: '/assets/', // Is this neccessary?
|
||||
filename: `[name].${buildTs}.js`,
|
||||
chunkFilename: `[name].${locale}.${buildTs}.js`,
|
||||
publicPath: '/assets/',
|
||||
filename: `[name].[chunkhash:8].js`,
|
||||
chunkFilename: `[name].${locale}.[chunkhash:8].js`,
|
||||
},
|
||||
|
||||
resolve: {
|
||||
|
@ -170,6 +165,8 @@ function buildWebpackClientConfig(
|
|||
},
|
||||
},
|
||||
|
||||
recordsPath: path.join(__dirname, 'records.json'),
|
||||
|
||||
stats: {
|
||||
colors: true,
|
||||
reasons: false,
|
||||
|
|
Loading…
Reference in New Issue
Block a user