How to use the @symfony/webpack-encore.createSharedEntry function in @symfony/webpack-encore

To help you get started, we’ve selected a few @symfony/webpack-encore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phpdish / phpdish / webpack.config.js View on Github external
function findEntries(entryPath){
    const entries = {};
    const srcDirName = entryPath + '/**/*.js';
    glob.sync(srcDirName).forEach(function (filepath) {
        const name = filepath.slice(filepath.indexOf('js'), -3);
        entries[name] = filepath;
    });
    return entries;
}
const foundEntries = findEntries(config.jsPath);
for (const entryName in foundEntries) {
    Encore.addEntry(entryName, foundEntries[entryName]);
}

//add shared entry
Encore.createSharedEntry('vendor', [
    path.resolve(config.modulesPath, 'common.js'),
    path.resolve(config.modulesPath, 'dialog.js'),

    'highlight.js',
    'codemirror',
    'codemirror/mode/markdown/markdown.js',
    'art-dialog',
    'art-dialog/css/dialog.css',
    'jquery-validation',
    'jquery-pjax',
    'bootstrap-select',
    'emojione',
    'twemoji',

    'github-markdown-css',
    'bootstrap-select/dist/css/bootstrap-select.min.css',