20 lines
438 B
JavaScript
20 lines
438 B
JavaScript
const { environment } = require('@rails/webpacker');
|
|
const webpack = require('webpack');
|
|
|
|
const jquery = new webpack.ProvidePlugin({
|
|
$: 'jquery',
|
|
jQuery: 'jquery',
|
|
'window.jQuery': 'jquery',
|
|
});
|
|
|
|
const yamlLoader = {
|
|
test: /\.ya?ml$/,
|
|
type: 'json', // Required by Webpack v4
|
|
use: 'yaml-loader',
|
|
};
|
|
|
|
environment.plugins.prepend('jquery', jquery);
|
|
environment.loaders.prepend('yaml', yamlLoader);
|
|
|
|
module.exports = environment;
|