From 5da5fa22eddcc0d26b628e5a8d68e5fda76c6ad3 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 16 May 2018 13:39:29 +0900 Subject: [PATCH] Add webpack plugins jQuery and Popper.js Signed-off-by: Kenji Okimoto --- config/webpack/environment.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/webpack/environment.js b/config/webpack/environment.js index ce13d2a..468a26c 100644 --- a/config/webpack/environment.js +++ b/config/webpack/environment.js @@ -1,5 +1,20 @@ const { environment } = require('@rails/webpacker') const vue = require('./loaders/vue') +const webpack = require('webpack'); + +// Get a pre-configured plugin +const manifestPlugin = environment.plugins.get('Manifest') +manifestPlugin.opts.writeToFileEmit = false + +// Add an additional plugin of your choosing : ProvidePlugin +environment.plugins.prepend( + 'Provide', + new webpack.ProvidePlugin({ + $: 'jquery/dist/jquery', + jQuery: 'jquery/dist/jquery', + Popper: 'popper.js/dist/popper' + }) +); environment.loaders.append('vue', vue) module.exports = environment