Skip to content

Load multiple entries from array #1048

@samikerb

Description

@samikerb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions