-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
53 lines (43 loc) · 1.41 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
50
51
52
53
const path = require('path');
const glob = require('tiny-glob/sync');
const brightpack = require('@mostlyserious/brightpack');
// const RealFaviconPlugin = require('@mostlyserious/brightpack/lib/real-favicon-plugin');
const dest = 'web/static';
const publicPath = '/static/';
const watch = [
'modules/**/*.{twig,html,php}',
'templates/**/*.{twig,html}',
'config/**/*.php'
];
module.exports = brightpack({ dest, publicPath, watch }, config => {
const assets = glob('src/{img,font,media}/**.*');
brightpack.editLoader(config, 'babel-loader', (use, rule) => {
});
config.entry = {
app: [
path.resolve('src/js/main.js'),
path.resolve('src/css/main.css'),
...assets.map(p => path.resolve(p))
]
};
// config.plugins.push(new RealFaviconPlugin({
// filename: global.inProduction
// ? 'favicon/[name].[contenthash:7]'
// : 'favicon/[name]',
// config: path.resolve('src/favicon/config.json')
// }));
config.cache = {
type: 'filesystem',
cacheDirectory: path.resolve(__dirname, '.cache/webpack'),
buildDependencies: {
config: [
__filename,
path.resolve(__dirname, 'babel.config.js'),
path.resolve(__dirname, 'postcss.config.js')
]
}
};
if (global.inProduction) {
}
return config;
});