2020-09-09 08:45:48 +02:00
|
|
|
const { environment } = require('@rails/webpacker');
|
2020-09-09 15:28:30 +02:00
|
|
|
const htmlErb = require('./loaders/html_erb');
|
|
|
|
const jsErb = require('./loaders/js_erb');
|
2020-09-09 11:54:49 +02:00
|
|
|
const html = require('./loaders/html');
|
|
|
|
const webpack = require('webpack');
|
2020-09-07 15:52:05 +02:00
|
|
|
|
2020-09-09 11:54:49 +02:00
|
|
|
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
|
2020-09-09 08:45:48 +02:00
|
|
|
$: 'jquery',
|
|
|
|
jQuery: 'jquery'
|
|
|
|
}));
|
|
|
|
|
2020-09-09 15:28:30 +02:00
|
|
|
environment.loaders.prepend('js.erb', jsErb);
|
|
|
|
environment.loaders.prepend('html.erb', htmlErb);
|
2020-09-09 11:54:49 +02:00
|
|
|
environment.loaders.append('html', html);
|
2020-09-09 15:28:30 +02:00
|
|
|
|
2020-09-09 08:51:53 +02:00
|
|
|
environment.splitChunks();
|
|
|
|
|
2020-09-09 08:45:48 +02:00
|
|
|
module.exports = environment;
|