-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
44 lines (39 loc) · 1.11 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-disable */
const Encore = require('@symfony/webpack-encore');
const HtmlWebpackPlugin = require('html-webpack-plugin');
Encore.setOutputPath('build/')
.setPublicPath('/')
.addEntry('app', './src/app/index.jsx')
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
.configureCssLoader(config => {
config.modules = true;
if (Encore.isProduction()) {
config.localIdentName = '[sha1:hash:hex:4]';
} else {
config.localIdentName = '[name]__[local]--[sha1:hash:hex:4]';
}
})
.addLoader(
{
test: /\.(pdf|zip)$/,
use: 'file-loader?name=[path][name].[ext]',
}
)
.enableReactPreset()
.enableSassLoader();
const config = Encore.getWebpackConfig();
config.plugins.push(
new HtmlWebpackPlugin({
// Also generate a test.html
template: 'src/app/app.html',
title: 'Brychan Bennett-Odlum',
meta: {
viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no',
},
})
);
module.exports = config;