How to use the @symfony/webpack-encore.autoProvideVariables 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 GraseHotspot / grase-www-portal / files / usr / share / grase / symfony4 / webpack.config.js View on Github external
// webpack.config.js
var Encore = require('@symfony/webpack-encore');

Encore.autoProvideVariables({
    'bazinga-translator': 'Translator'
})

Encore
    // directory where compiled assets will be stored
    .setOutputPath('public/build/')

    // the public path used by the web server to access the previous directory
    .setPublicPath(Encore.isProduction() ? '/grase/build' : '/build')
    .setManifestKeyPrefix('build')

    // will create public/build/app.js and public/build/app.css
    .addEntry('app', './assets/js/app.js')

    // will create public/build/uam.js and public/build/uam.css
    .addEntry('uam', './assets/js/uam.js')