lazy loading mutiple contexts in webpack -


i want load 2 modules 2 different contexts (possibly in single chunk) after i've read navigator.language, suppose have lazy load, working:

 var loaddata = require('bundle?lazy&name=intl!react-intl/locale-data/' + navigator.language + '.js');  var loadtranslation = require('bundle?lazy&name=intl!translantion/' + navigator.language + '.js');   loaddata (function (a) {    loadtranslation (function (b) {       console.log('i can\'t believe have wait ', a, b);    }  }); 

but hoping better syntax, have tried require.ensure, , with

require(['bundle?lazy!react-intl/locale-data/' + navigator.language + '.js','bundle?lazy!translantion/' + navigator.language + '.js'],    function (a, b) {     console.log('what doing wrong?'); }); 

but either "require function used in way in dependencies cannot statically extracted", or messages not there yet when render, idea?


Comments

Popular posts from this blog

Sass watch command compiles .scss files before full sftp upload -

filehandler - java open files not cleaned, even when the process is killed -

gridview - Yii2 DataPorivider $totalSum for a column -