-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (44 loc) · 1.28 KB
/
webpack.config.js
File metadata and controls
54 lines (44 loc) · 1.28 KB
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
var Encore = require('@symfony/webpack-encore');
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// Build Config
.setOutputPath('public/build/')
.setPublicPath('/build')
// Assets
.addStyleEntry('styles', './assets/css/app.css')
//.addEntry('scripts', './assets/js/app.js')
.addEntry('scripts', './assets/ts/app.ts')
.copyFiles({
from: './assets/img',
to: 'img/[path][name].[ext]',
})
.copyFiles({
from: './assets/icons',
to: 'icons/[path][name].[ext]',
})
// Build Features
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
// Production Config
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
// Add Vue
.enableVueLoader()
// Add TypeScript
.enableTypeScriptLoader()
// Add PostCSS
.enablePostCssLoader()
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()
// uncomment if you use API Platform Admin (composer require api-admin)
//.enableReactPreset()
//.addEntry('admin', './assets/js/admin.js')
;
module.exports = Encore.getWebpackConfig();