How to use the @rails/webpacker.webpackConfig 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 scottrobertson / rails-vue-template / config / webpack / base.js View on Github external
const Webpacker = require("@rails/webpacker");
const vueConfig = require("./rules/vue");

// Disabling `optimization` because the Webpack chunks aren't getting executed.
// That is, the HTML will load and the JavaScript is "pre-loaded" into "named
// chunks" but those chunks are never executed, so the Vue app is never started.
delete Webpacker.webpackConfig.optimization;

const cssConfig = {
  resolve: {
    extensions: [".css"],
  },
};

// Merge vueConfig first: https://github.com/rails/webpacker/issues/2835#issuecomment-759772592
module.exports = Webpacker.merge(vueConfig, Webpacker.webpackConfig, cssConfig);
github scottrobertson / rails-vue-template / config / webpack / base.js View on Github external
const Webpacker = require("@rails/webpacker");
const vueConfig = require("./rules/vue");

// Disabling `optimization` because the Webpack chunks aren't getting executed.
// That is, the HTML will load and the JavaScript is "pre-loaded" into "named
// chunks" but those chunks are never executed, so the Vue app is never started.
delete Webpacker.webpackConfig.optimization;

const cssConfig = {
  resolve: {
    extensions: [".css"],
  },
};

// Merge vueConfig first: https://github.com/rails/webpacker/issues/2835#issuecomment-759772592
module.exports = Webpacker.merge(vueConfig, Webpacker.webpackConfig, cssConfig);