2022-03-09 17:37:59 +01:00
|
|
|
const { webpackConfig, merge } = require('shakapacker');
|
2022-03-14 13:59:57 +01:00
|
|
|
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');
|
2022-03-09 16:31:38 +01:00
|
|
|
|
|
|
|
// See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig.
|
2022-03-09 17:37:59 +01:00
|
|
|
const customConfig = {
|
2022-03-14 13:59:57 +01:00
|
|
|
plugins: [
|
|
|
|
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']
|
|
|
|
})
|
|
|
|
],
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
jsErb,
|
|
|
|
htmlErb,
|
|
|
|
sassErb,
|
|
|
|
js,
|
|
|
|
html,
|
|
|
|
sass,
|
|
|
|
uiTour
|
|
|
|
]
|
|
|
|
},
|
2022-03-09 17:37:59 +01:00
|
|
|
resolve: {
|
2022-03-14 13:59:57 +01:00
|
|
|
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.tiff', '.ico',
|
|
|
|
'.svg', '.eot', '.otf', '.ttf', '.woff', '.woff2',
|
|
|
|
'.tsx', '.ts', '.erb', '.html', '.mjs', '.js', '.jsx',
|
|
|
|
'.sass', '.scss', '.css', '.module.sass', '.module.scss', '.module.css']
|
2022-03-09 17:37:59 +01:00
|
|
|
}
|
|
|
|
};
|
2022-03-09 16:31:38 +01:00
|
|
|
|
2022-03-09 17:37:59 +01:00
|
|
|
module.exports = merge(webpackConfig, customConfig);
|