Answer the question
In order to leave comments, you need to log in
How to pass backend variable to WebPack module on frontend?
Actually, everything is in the subject.
I had such a thought.
1. Pack AMD library:
output: {
publicPath: '/js/',
path: __dirname + '/web/js',
library: 'backend',
libraryTarget: "amd",
filename: '[name].js',
chunkFilename: 'chunk-[id].js'
}
;(function(){
var Entry = require('./entries/users/index');
var entry = new Entry({
... // <--- тут опции, сгенерированные кодом бэкэнда (PHP)
});
})();
ReferenceError: require is not defined
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question