Add webpack plugins jQuery and Popper.js

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-05-16 13:39:29 +09:00
parent 6c867de70c
commit 5da5fa22ed

View File

@ -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