How to use the @symfony/webpack-encore.getWebpackConfig 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 Limenius / symfony-react-sandbox / webpack.config.js View on Github external
// empty the outputPath dir before each build
    .cleanupOutputBeforeBuild()
    // will output as web/build/app.js
    .addEntry('app', ['babel-polyfill', 'whatwg-fetch', './assets/js/entryPoint.js'])
    // will output as web/build/app.css
    .addStyleEntry('css/main', './assets/sass/layout.scss')
    // allow sass/scss files to be processed
    .enableSassLoader()
    // allow legacy applications to use $/jQuery as a global variable
    .autoProvidejQuery()
    // create hashed filenames (e.g. app.abc123.css)
    .enableVersioning(Encore.isProduction())
    .enableSourceMaps(!Encore.isProduction())

// export the final configuration
module.exports = Encore.getWebpackConfig()
github Limenius / symfony-react-sandbox / webpack.config.serverside.js View on Github external
var Encore = require('@symfony/webpack-encore');

Encore
    // directory where all compiled assets will be stored
    .setOutputPath('var/webpack/')
    // what's the public path to this directory (relative to your project's document root dir)
    .setPublicPath('/')
    // empty the outputPath dir before each build
    .cleanupOutputBeforeBuild()
    // will output as app/Resources/webpack/server-bundle.js
    .addEntry('server-bundle', ['babel-polyfill', './assets/js/entryPoint.js'])
    // allow legacy applications to use $/jQuery as a global variable
    .autoProvidejQuery()

// export the final configuration
module.exports = Encore.getWebpackConfig()
github GaetanRole / sf4.4-website-skeleton-starter / webpack.config.js View on Github external
.autoProvidejQuery()
    .splitEntryChunks()

    // Copy all files from assets/ with path
    .copyFiles([
        {from: './assets/images', to: 'images/[path][name].[hash:8].[ext]'},
    ])

    // Enables @babel/preset-env polyfills
    .configureBabel(() => {}, {
        useBuiltIns: 'usage',
        corejs: 3
    })
;

module.exports = Encore.getWebpackConfig();
github regiomedia / bitrix-project / webpack.config.js View on Github external
// https://webpack.js.org/plugins/define-plugin/
    .configureDefinePlugin((options) => {
        options.DEBUG =  !Encore.isProduction();
    })

    // create hashed filenames (e.g. app.abc123.css)

    .configureFilenames({
      js: '[name].[hash:8].js',
    })
  
    .enableVersioning()
;

var config =  Encore.getWebpackConfig();
config.externals = {
    jquery: 'jQuery',
    BX: 'BX'
};


// export the final configuration
module.exports = config;
github PHPcomRapadura / site-principal / application / webpack.config.js View on Github external
.enableSourceMaps(!Encore.isProduction())
    // uncomment to create hashed filenames (e.g. app.abc123.css)
    // .enableVersioning(Encore.isProduction())

    // uncomment to define the assets of the project
    // .addEntry('js/app', './assets/js/app.js')
    // .addStyleEntry('css/app', './assets/css/app.scss')

    // uncomment if you use Sass/SCSS files
    // .enableSassLoader()

    // uncomment for legacy applications that require $/jQuery as a global variable
    // .autoProvidejQuery()
;

module.exports = Encore.getWebpackConfig();
github HecFranco / Symfony-4-by-Samples / 07_Security / 03_Complete_Login_and_Registration_System / webpack.config.js View on Github external
// uncomment to define the assets of the project
    // .addEntry('js/app', './assets/js/app.js')
    .addEntry('js/app', './assets/js/app.js')
    .addEntry('js/app_security_forms', './assets/js/app_security_forms.js')
    // .addStyleEntry('css/app', './assets/css/app.scss')
    .addStyleEntry('css/app', './assets/css/app.scss')
    // uncomment if you use Sass/SCSS files
    // .enableSassLoader()
    .enableSassLoader()

    // uncomment for legacy applications that require $/jQuery as a global variable
    .autoProvidejQuery()
;

module.exports = Encore.getWebpackConfig();
github ElisDN / demo-project-manager / manager / webpack.config.js View on Github external
// uncomment if you use TypeScript
    //.enableTypeScriptLoader()

    // uncomment to get integrity="..." attributes on your script & link tags
    // requires WebpackEncoreBundle 1.4 or higher
    //.enableIntegrityHashes()

    // uncomment if you're having problems with a jQuery plugin
    //.autoProvidejQuery()

    // uncomment if you use API Platform Admin (composer req api-admin)
    //.enableReactPreset()
    //.addEntry('admin', './assets/js/admin.js')
;

module.exports = Encore.getWebpackConfig();
github opensalt / opensalt / webpack.config.js View on Github external
test: /jquery-(migrate|ui)(|.min).js$/,
        use: [
            {
              loader: 'imports-loader?define=>false'
            }
        ]
    })
;
/*
console.log(Encore.getWebpackConfig());
console.log(Encore.getWebpackConfig().plugins);
console.log(Encore.getWebpackConfig().module.rules);
console.log(JSON.stringify(Encore.getWebpackConfig().module.rules, false, 2));
*/

const config = Encore.getWebpackConfig();
config.context = __dirname;
config.resolve.alias = {
  'jquery': path.resolve(__dirname, npmDir+'/jquery/dist/jquery.js'),
  //'jquery-ui': path.resolve(__dirname, npmDir+'/jquery-ui/jquery-ui.js'),
  'jquery-ui': path.resolve(__dirname, npmDir+'/jquery-ui-bundle/jquery-ui.js'),
  //'datatables.net': path.resolve(__dirname, npmDir+'/datatables.net/js/jquery.dataTables.js'),
  //'jquery-ui/ui/widgets/menu': path.resolve(__dirname, npmDir+'/jquery-ui/ui/widgets/menu.js'),
  //'simplemde': path.resolve(__dirname, npmDir+'/simplemde/dist/simplemde.min.js'),
  //'papaparse': path.resolve(__dirname, npmDir+'/papaparse/papaparse.min.js'),
  //'markdown-it-underline': path.resolve(__dirname, npmDir+'/markdown-it-underline/index.js'),
  'render-md': path.resolve(__dirname, assetsDir+'/js/cftree/render-md.js'),
  'util-salt': path.resolve(__dirname, assetsDir+'/js/util-salt.js'),
  'ajaxq': path.resolve(__dirname, npmDir+'/ajaxq/ajaxq.js')
};
config.resolve.modules = [
  'node_modules',
github Monofony / Monofony / assets / config-builder.js View on Github external
.copyFiles({
            from: `./assets/${name}/img`,
            to: 'img/[path][name].[ext]',
        }, {
            from: upath.joinSafe(vendorUiPath, 'Resources/private/img'),
            to: 'img/[path][name].[ext]',
        })
        .configureFilenames({
            js: 'js/[name].[hash:8].js',
            css: 'css/[name].[hash:8].css',
            images: 'img/[name].[hash:8].[ext]',
            fonts: 'font/[name].[hash:8].[ext]'
        });
    ;

    const config = Encore.getWebpackConfig();
    config.name = name;
    config.resolve.alias = {
        '~': path.resolve(__dirname, '../../')
    };

    Encore.reset();

    return config;
};
module.exports = build;
github Intracto / SecretSanta / webpack.config.js View on Github external
.addEntry('js/recaptcha', './src/Intracto/SecretSantaBundle/Resources/public/js/recaptcha.js')

    .addStyleEntry('css/main', [
        './src/Intracto/SecretSantaBundle/Resources/public/scss/main.scss',
        'jquery-ui/themes/base/core.css',
        'jquery-ui/themes/base/sortable.css',
    ])

    .addStyleEntry('css/update', './src/Intracto/SecretSantaBundle/Resources/public/css/update.css')
    .addStyleEntry('css/report', './src/Intracto/SecretSantaBundle/Resources/public/css/report.css')
    .addStyleEntry('css/mediaqueries', './src/Intracto/SecretSantaBundle/Resources/public/css/mediaqueries.css')

    .enableSourceMaps(!Encore.isProduction())
;

var config = Encore.getWebpackConfig();

config.resolve = {
    alias: {
        '@': path.resolve(__dirname, 'src/Intracto/SecretSantaBundle/Resources/public/'),
        AppConfig: path.resolve(__dirname, 'app/config/'),
    }
};

module.exports = config;