forked from chamilo/chamilo-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
69 lines (55 loc) · 2.03 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
59
60
61
62
63
64
65
66
67
68
69
var Encore = require('@symfony/webpack-encore');
var copyWebpackPlugin = require('copy-webpack-plugin');
var fileManagerPlugin = require('filemanager-webpack-plugin');
Encore
.setOutputPath('public/build/')
.setManifestKeyPrefix('public/build/')
.setPublicPath('../')
.cleanupOutputBeforeBuild()
.addEntry('app', './assets/js/app.js')
.addEntry('bootstrap', './assets/js/bootstrap.js')
.addEntry('free-jqgrid', './assets/js/free-jqgrid.js')
.addStyleEntry('css/app', './assets/css/app.scss')
.addStyleEntry('css/bootstrap', './assets/css/bootstrap.scss')
.addStyleEntry('css/chat', './assets/css/chat.css')
.addStyleEntry('css/document', './assets/css/document.css')
.addStyleEntry('css/editor', './assets/css/editor.css')
.addStyleEntry('css/editor_content', './assets/css/editor_content.css')
.addStyleEntry('css/markdown', './assets/css/markdown.css')
.addStyleEntry('css/print', './assets/css/print.css')
.addStyleEntry('css/responsive', './assets/css/responsive.css')
.addStyleEntry('css/scorm', './assets/css/scorm.css')
.enableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
// .enableVersioning(Encore.isProduction())
.enableSassLoader()
.autoProvidejQuery()
;
var themes = [
'chamilo'
];
// Add Chamilo themes
themes.forEach(function (theme) {
Encore.addStyleEntry('css/themes/' + theme + '/default', './assets/css/themes/' + theme + '/default.css');
// Copy images from themes into public/build
Encore.addPlugin(new copyWebpackPlugin([{
from: 'assets/css/themes/' + theme + '/images',
to: 'css/themes/' + theme + '/images'
},
]));
});
// Fix free-jqgrid langiages files
Encore.addPlugin(new fileManagerPlugin({
onEnd: {
move: [
{
source: './public/public/build/free-jqgrid/',
destination: './public/build/free-jqgrid/'
}
],
delete: [
'./public/public/'
]
}
}));
module.exports = Encore.getWebpackConfig();