forked from mollie/WooCommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (44 loc) · 1.52 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
const Encore = require('@symfony/webpack-encore')
function extractEncoreConfig (name)
{
const config = Encore.getWebpackConfig()
Encore.reset()
return { ...config, name }
}
function configJavaScript ({ basePath })
{
Encore
.setOutputPath(`${basePath}/public/js`)
.setPublicPath('/public/js')
.disableSingleRuntimeChunk()
.addEntry('babel-polyfill.min', '@babel/polyfill')
.addEntry('applepay.min', './resources/js/applepay.js')
.addEntry('applepayDirect.min', './resources/js/applepayDirect.js')
.addEntry('applepayDirectCart.min', './resources/js/applepayDirectCart.js')
.addEntry('settings.min', './resources/js/settings.js')
.addEntry('mollie-components.min', './resources/js/mollie-components.js')
.enableSourceMaps(!Encore.isProduction())
return extractEncoreConfig('javascript-configuration')
}
function configCss ({ basePath })
{
Encore
.setOutputPath(`${basePath}/public/css`)
.setPublicPath('/public/css')
.disableSingleRuntimeChunk()
.enableSassLoader()
.addStyleEntry('mollie-components.min', './resources/scss/mollie-components.scss')
.addStyleEntry('unabledButton.min', './resources/scss/unabledButton.scss')
.addStyleEntry('mollie-applepaydirect.min', './resources/scss/mollie-applepaydirect.scss')
.enableSourceMaps(!Encore.isProduction())
return extractEncoreConfig('css-configuration')
}
function config (env)
{
const config = [
configJavaScript(env),
configCss(env)
]
return [...config]
}
module.exports = env => config(env)