-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
57 lines (40 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
54
55
56
57
const Encore = require('@symfony/webpack-encore');
const jsonImporter = require('node-sass-json-importer');
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
const CopyWebpackPlugin = require('copy-webpack-plugin')
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('js/custom_image', './assets/js/custom_image.js')
.addEntry('js/layout', './assets/js/layout.js')
.addStyleEntry('css/global', './assets/css/global.scss')
.enableSingleRuntimeChunk()
//.disableSingleRuntimeChunk()
/*.enableBuildNotifications(true, (options) => {
options.alwaysNotify = true;
})*/
.addPlugin(new WebpackBuildNotifierPlugin({
title: "Custom Image",
//logo: path.resolve("./img/logo.png"),
// successIcon: path.resolve("./img/success.png"),
warningSound: false
}))
.addPlugin(new CopyWebpackPlugin([
{
from: './assets/static',
to: 'static'
}
]))
.configureBabel(function (babelConfig) {
babelConfig.presets[0][1].corejs = 2;
}, {})
.enableSassLoader(function (options) {
options.importer = jsonImporter()
})
.enableSourceMaps(!Encore.isProduction())
.cleanupOutputBeforeBuild()
.autoProvidejQuery()
.enableVersioning(!Encore.isDevServer())
;
// export the final configuration
module.exports = Encore.getWebpackConfig();