forked from shopware/braintree-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
58 lines (45 loc) · 1.35 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
58
const path = require("path");
const Encore = require('@symfony/webpack-encore');
const Dotenv = require('dotenv-webpack');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('admin', './assets/admin.ts')
.splitEntryChunks()
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = '3.23';
})
.enableSassLoader()
.enableTypeScriptLoader()
.enableVueLoader(() => {}, { runtimeCompilerBuild: true })
.enableIntegrityHashes(Encore.isProduction())
.copyFiles({
from: './assets/img',
to: 'img/[path][name].[ext]',
pattern: /\.(png|jpg|jpeg|svg|webp)$/,
})
.addAliases({
'@': path.resolve(__dirname, 'assets/src'),
})
;
Encore.addPlugin(
new Dotenv({
path: ".env.local",
defaults: ".env",
systemvars: true,
allowEmptyValues: true,
})
)
Encore.configureDefinePlugin(options => {
options.__VUE_OPTIONS_API__ = true;
options.__VUE_PROD_DEVTOOLS__ = false;
});
module.exports = Encore.getWebpackConfig();