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
2020-11-25 17:13:45 +01:00

39 lines
1.3 KiB
JavaScript

const { environment } = require('@rails/webpacker');
const webpack = require('webpack');
const path = require('path');
const htmlErb = require('./loaders/html_erb');
const js = require('./loaders/js');
const jsErb = require('./loaders/js_erb');
const sass = require('./loaders/sass');
const sassErb = require('./loaders/sass_erb');
const html = require('./loaders/html');
const uiTour = require('./loaders/ui-tour');
environment.plugins.prepend('Provide', new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
_: 'lodash',
Hone: 'hone',
Tether: 'tether',
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']
}));
environment.loaders.prepend('js-erb', jsErb);
environment.loaders.prepend('html-erb', htmlErb);
environment.loaders.prepend('sass-erb', sassErb);
environment.loaders.prepend('js', js);
environment.loaders.append('html', html);
environment.loaders.append('sass', sass);
environment.loaders.append('uiTour', uiTour);
environment.splitChunks();
module.exports = environment;