2020-09-09 08:45:48 +02:00
|
|
|
const { environment } = require('@rails/webpacker');
|
2020-09-22 14:46:13 +02:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
|
|
|
|
2020-09-09 15:28:30 +02:00
|
|
|
const htmlErb = require('./loaders/html_erb');
|
2020-09-22 14:20:47 +02:00
|
|
|
const js = require('./loaders/js');
|
2020-09-09 15:28:30 +02:00
|
|
|
const jsErb = require('./loaders/js_erb');
|
2020-09-15 12:57:54 +02:00
|
|
|
const sass = require('./loaders/sass');
|
2020-09-14 16:08:39 +02:00
|
|
|
const sassErb = require('./loaders/sass_erb');
|
2020-09-09 11:54:49 +02:00
|
|
|
const html = require('./loaders/html');
|
2020-10-07 14:25:48 +02:00
|
|
|
const uiTour = require('./loaders/ui-tour');
|
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',
|
2020-09-14 16:08:39 +02:00
|
|
|
jQuery: 'jquery',
|
|
|
|
'window.jQuery': 'jquery',
|
2020-09-28 18:11:56 +02:00
|
|
|
_: 'lodash',
|
2020-09-22 16:46:35 +02:00
|
|
|
Holder: 'holderjs',
|
|
|
|
'window.CodeMirror': 'codemirror',
|
|
|
|
MediumEditor: 'medium-editor',
|
2020-09-21 14:50:28 +02:00
|
|
|
Humanize: path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/lib/humanize.js')),
|
|
|
|
moment: 'moment',
|
2020-09-21 13:23:28 +02:00
|
|
|
Application: [path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/app.js')), 'Application']
|
2020-09-09 08:45:48 +02:00
|
|
|
}));
|
|
|
|
|
2020-09-15 12:57:54 +02:00
|
|
|
environment.loaders.prepend('js-erb', jsErb);
|
|
|
|
environment.loaders.prepend('html-erb', htmlErb);
|
2020-09-14 16:08:39 +02:00
|
|
|
environment.loaders.prepend('sass-erb', sassErb);
|
2020-09-22 14:20:47 +02:00
|
|
|
environment.loaders.prepend('js', js);
|
2020-09-09 11:54:49 +02:00
|
|
|
environment.loaders.append('html', html);
|
2020-09-15 12:57:54 +02:00
|
|
|
environment.loaders.append('sass', sass);
|
2020-10-07 14:25:48 +02:00
|
|
|
environment.loaders.append('uiTour', uiTour);
|
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;
|