How to use the @rails/webpacker.environment.toWebpackConfig function in @rails/webpacker

To help you get started, we’ve selected a few @rails/webpacker 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 restarone / violet_rails / config / webpack / environment.js View on Github external
const { environment } = require('@rails/webpacker')
const erb = require('./loaders/erb')

const webpack = require("webpack")
environment.plugins.append("Provide", new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
}))

const config = environment.toWebpackConfig();


config.resolve.alias = {
  jquery: 'jquery/src/jquery'
 };
// bootstrap jquery setup


environment.loaders.prepend('erb', erb)
module.exports = environment
github next-l / enju_leaf / lib / generators / enju_leaf / setup / templates / config / webpack / environment.js View on Github external
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
environment.plugins.prepend(
  'Provide',
  new webpack.ProvidePlugin({
    $: 'jquery',
    jQuery: 'jquery',
    jquery: 'jquery'
  })
)

const config = environment.toWebpackConfig()
config.resolve.alias = {
  jquery: "jquery/src/jquery"
}

module.exports = environment
github ministryofjustice / laa-apply-for-legal-aid / config / webpack / environment.js View on Github external
const { environment } = require('@rails/webpacker')

const webpack = require('webpack')
environment.plugins.append('Provide', new webpack.ProvidePlugin({
  $: 'jquery',
  jQuery: 'jquery',
  jquery: 'jquery'
}))

const config = environment.toWebpackConfig()

config.resolve.alias = {
  jquery: 'jquery/src/jquery'
}

module.exports = environment