-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
49 lines (43 loc) · 1.3 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
45
46
47
48
49
const path = require("path");
const { merge } = require("webpack-merge");
const CopyPlugin = require("copy-webpack-plugin");
let config = require("./config/webpack.defaults.js");
// Add any overrides to the default webpack config here:
//
// Eg:
//
// ```
// const path = require("path")
// config.resolve.modules.push(path.resolve(__dirname, 'frontend', 'components'))
// config.resolve.alias.frontendComponents = path.resolve(__dirname, 'frontend', 'components')
// ```
//
// You can also merge in a custom config using the included `webpack-merge` package.
// Complete docs available at: https://github.com/survivejs/webpack-merge
//
// Eg:
//
// ```
// const customConfig = { ..... }
// config = merge(config, customConfig)
// ```
const customConfig = {
plugins: [
new CopyPlugin({
patterns: [
{
from: path.resolve(__dirname, "frontend/**/*.{png,svg,jpg,jpeg,gif,json,geojson}"),
to({ context, absoluteFilename }) {
return `${path.relative(
`${context}/frontend/javascript`,
path.dirname(absoluteFilename)
)}/[name].[contenthash][ext]`;
},
},
],
}),
],
};
config = merge(config, customConfig);
////////////////////////////////////////////////////////
module.exports = config;