How to use the @symfony/webpack-encore.setOutputPath 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 Noelierx / GameHer / webpack.config.js View on Github external
var Encore = require('@symfony/webpack-encore');

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
    // directory where compiled assets will be stored
    .setOutputPath('public/build/')
    // public path used by the web server to access the output path
    .setPublicPath('/build')
    // only needed for CDN's or sub-directory deploy
    //.setManifestKeyPrefix('build/')

    /*
     * ENTRY CONFIG
     *
     * Add 1 entry for each "page" of your app
     * (including one that's included on every page - e.g. "app")
     *
     * Each entry will result in one JavaScript file (e.g. app.js)
     * and one CSS file (e.g. app.css) if your JavaScript imports CSS.
     */
github async-aws / aws / website / webpack.config.js View on Github external
var Encore = require('@symfony/webpack-encore');

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
    // directory where compiled assets will be stored
    .setOutputPath('template/assets/')
    // public path used by the web server to access the output path
    .setPublicPath('/assets')
    .addEntry('app', './assets/script/main.js')

    .copyFiles({
        from: './assets/image',

        // if versioning is enabled, add the file hash too
        to: 'image/[path][name].[hash:8].[ext]',

        // only copy files matching this pattern
        pattern: /\.(png|jpg|jpeg|svg|webmanifest)$/
    })
github kevinpapst / kimai2 / webpack.config.js View on Github external
// Hint: if something doesn't work as expected: yarn upgrade --latest

var Encore = require('@symfony/webpack-encore');
var webpack = require('webpack');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('build/')
    .setManifestKeyPrefix('build/')
    .cleanupOutputBeforeBuild()

    .addEntry('app', './assets/app.js')
    .addEntry('invoice', './assets/invoice.js')
    .addEntry('invoice-pdf', './assets/invoice-pdf.js')
    .addEntry('chart', './assets/chart.js')
    .addEntry('calendar', './assets/calendar.js')
    .copyFiles({ from: './assets/images', to: 'images/[path][name].[ext]' })

    .splitEntryChunks()
    .enableSingleRuntimeChunk()
    .enableIntegrityHashes()
    .enableVersioning(Encore.isProduction())
github forkcms / forkcms / webpack.config.js View on Github external
const themePaths = {
  build: `src/Frontend/Themes/${env.parsed.THEME}/Core/build`,
  core: `src/Frontend/Themes/${env.parsed.THEME}/Core`
}

// START INSTALLER SETUP
//

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
  // Set the runtime environment
  Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev')
}

Encore
  .setOutputPath('src/ForkCMS/Bundle/InstallerBundle/Resources/public/build/')
  .setPublicPath('/src/ForkCMS/Bundle/InstallerBundle/Resources/public/build')
  .setManifestKeyPrefix('src/ForkCMS/Bundle/InstallerBundle/Resources/public/build/')

  .addEntry('installer', './src/ForkCMS/Bundle/InstallerBundle/Resources/public/js/Installer.js')
  .addStyleEntry('screen', './src/ForkCMS/Bundle/InstallerBundle/Resources/public/Sass/screen.scss')

  .cleanupOutputBeforeBuild()

  // will require an extra script tag for runtime.js
  // but, you probably want this, unless you're building a single-page app
  .enableSingleRuntimeChunk()
  .enableSassLoader((options) => {}, {
    resolveUrlLoader: false
  })
  .enablePostCssLoader()
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')

    // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
    .splitEntryChunks()
github allejo / bzion / webpack.config.js View on Github external
var Encore = require('@symfony/webpack-encore');

var ModernizrWebpackPlugin = require('modernizr-webpack-plugin');

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

    // what's the public path to this directory (relative to your project's document root dir)
    .setPublicPath('/build')

    // empty the outputPath dir before each build
    .cleanupOutputBeforeBuild()

    // will output as web/build/app.js
    .addEntry('app', './assets/js/main.js')

    // allow legacy applications to use $/jQuery as a global variable
    .autoProvidejQuery()

    // Modernizr configuration
github opensalt / opensalt / webpack.config.js View on Github external
npmDir+'/datatables.net-select/js/dataTables.select.js',
    //npmDir+'/ui-contextmenu/jquery.ui-contextmenu.js',
    npmDir+'/bootstrap-multiselect/dist/js/bootstrap-multiselect.js',
    npmDir+'/select2/dist/js/select2.full.js',
    //vendorDir+'/tetranz/select2entity-bundle/Tetranz/Select2EntityBundle/Resources/public/js/select2entity.js',
    npmDir+'/select2entity-bundle/Resources/public/js/select2entity.js',
    npmDir+'/twbs-pagination/jquery.twbsPagination.js',
    npmDir+'/bootstrap-notify/bootstrap-notify.min.js',
    assetsDir+'/js/application.js',
    assetsDir+'/js/lsdoc/index.js',
    npmDir+'/papaparse/papaparse.min.js',
    npmDir+'/ajaxq/ajaxq.js',
    './build/js/apx.js'
];

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()

    .addEntry('modernizr', npmDir+'/html5-boilerplate/dist/js/vendor/modernizr-3.5.0.min.js')
    .addEntry('site', mainScripts)
    .addEntry('comments', [
        npmDir+'/jquery-comments/js/jquery-comments.js',
        assetsDir+'/js/lsdoc/comments.js'
    ])

    .createSharedEntry('base', sharedScripts)

    .addStyleEntry('main', [
//        npmDir+'/fancytree/dist/skin-lion/ui.fancytree.css',
//        vendorDir+'/mervick/material-design-icons/scss/material-icons.scss',
github forkcms / forkcms / webpack.config.js View on Github external
//
// END INSTALLER SETUP

// ===========================

// START BACKEND
//

// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
  // Set the runtime environment
  Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev')
}

Encore
  .setOutputPath('src/Backend/Core/build/')
  .setPublicPath('/src/Backend/Core/build')
  .setManifestKeyPrefix('src/Backend/Core/build/')

  .addEntry('backend', './src/Backend/Core/Js/Backend.js')
  .addStyleEntry('screen', './src/Backend/Core/Layout/Sass/screen.scss')

  .cleanupOutputBeforeBuild()

  // will require an extra script tag for runtime.js
  // but, you probably want this, unless you're building a single-page app
  .enableSingleRuntimeChunk()
  .enableSassLoader((options) => {}, {
    resolveUrlLoader: false
  })
  .enablePostCssLoader()
github moay / server-for-symfony-flex / webpack.config.js View on Github external
var Encore = require('@symfony/webpack-encore');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()
    .enableSourceMaps(!Encore.isProduction())
    .enableVersioning(Encore.isProduction())
    .enableVueLoader()
    .enableSingleRuntimeChunk()
    .addEntry('dashboard', './assets/js/dashboard.js')
;

module.exports = Encore.getWebpackConfig();
github andchir / shopkeeper4 / public / webpack.config.js View on Github external
var Encore = require('@symfony/webpack-encore');

Encore
    .setOutputPath('app_build/')
    .setPublicPath('.')
    .setManifestKeyPrefix('app_build')
    .addEntry('app', './js/app.js')
    .addStyleEntry('app_styles', [
        './node_modules/bootstrap/dist/css/bootstrap.min.css',
        './node_modules/nouislider/distribute/nouislider.min.css',
        './node_modules/slick-carousel/slick/slick.css',
        './node_modules/slick-carousel/slick/slick-theme.css',
        './css/icomoon/style.css',
        './css/dots-menu.css',
        './css/shopkeeper.css',
        './css/shopping_cart.css',
        './css/app.css'
    ])
    .cleanupOutputBeforeBuild()