How to use the @symfony/webpack-encore.setPublicPath 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
'_': 'lodash',
        "window.lodash": "lodash"
    })
    .addExternals({
        'jquery': 'window.$',
        'jQuery': 'window.$',
        'lodash': 'window._',
    })
    .addRule({
        test: /\.njk$/,
        loader: 'nunjucks-loader'
    });

if (!Encore.isProduction()) {
    Encore.enableVersioning(false);
    Encore.setPublicPath('http://127.0.0.1:8089')
        .setManifestKeyPrefix('build/');
}

//add js entries
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]);
github enhavo / enhavo / assets / node_modules / @enhavo / core / EnhavoEncore.js View on Github external
add(name, callback)
    {
        Encore.reset();
        Encore.setOutputPath('public/build/'+name+'/');
        Encore.setPublicPath('/build/'+name);

        for(let enhavoPackage of this.packages) {
            enhavoPackage.initEncore(Encore, name)
        }

        callback(Encore);

        let config = Encore.getWebpackConfig();
        config.name = name;
        this.configs.push(config);

        for(let enhavoPackage of this.packages) {
            enhavoPackage.initWebpackConfig(config, name)
        }

        return config;