1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/config/webpack/environment.js

39 lines
1.3 KiB
JavaScript
Raw Normal View History

const { environment } = require('@rails/webpacker');
const webpack = require('webpack');
const path = require('path');
const htmlErb = require('./loaders/html_erb');
2020-09-22 14:20:47 +02:00
const js = require('./loaders/js');
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-09 11:54:49 +02:00
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
$: 'jquery',
2020-09-14 16:08:39 +02:00
jQuery: 'jquery',
'window.jQuery': 'jquery',
2020-09-28 18:11:56 +02:00
_: 'lodash',
Hone: 'hone',
Tether: 'tether',
2020-09-22 16:46:35 +02:00
Holder: 'holderjs',
'window.CodeMirror': 'codemirror',
MediumEditor: 'medium-editor',
Humanize: path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/lib/humanize.js')),
moment: 'moment',
Application: [path.resolve(path.join(__dirname, '../../app/frontend/src/javascript/app.js')), 'Application']
}));
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 08:51:53 +02:00
environment.splitChunks();
module.exports = environment;