webpack-encore icon indicating copy to clipboard operation
webpack-encore copied to clipboard

Load multiple entries from array

Open samikerb opened this issue 4 years ago • 4 comments
trafficstars

Hello,

i have a function that returns all assets as array :

`function getEntryFiles() { const entries = { // 3rd party plugins css/js 'plugins/global/plugins.bundle': ['./webpack/plugins/plugins.js', './webpack/plugins/plugins.scss'], // Theme css/js 'css/style.bundle': ['./' + path.relative('./', srcPath) + '/sass/style.scss', './' + path.relative('./', srcPath) + '/sass/plugins.scss'], 'js/scripts.bundle': './webpack/scripts.' + demo + '.js', };

// Custom 3rd party plugins
(glob.sync('./webpack/{plugins,js}/custom/**/*.+(js)') || []).forEach(file => {
    let loc = file.replace('webpack/', '').replace('./', '');
    loc = loc.replace('.js', '.bundle');
    entries[loc] = file;
});

// Custom JS files from src folder
(glob.sync(path.relative('./', srcPath) + '/js/custom/**/!(_)*.js') || []).forEach(file => {
    entries[file.replace(/.*js\/(.*?)\.js$/ig, 'js/$1')] = './' + file;
});

return entries;

}`

How can i add theses to the configuration ?

Thank you

samikerb avatar Sep 19 '21 18:09 samikerb

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Dec 03 '24 12:12 carsonbot

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Jun 04 '25 12:06 carsonbot

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

carsonbot avatar Jun 18 '25 12:06 carsonbot

Hello, you can close thank you

samiker avatar Jun 18 '25 20:06 samiker