forked from chamilo/chamilo-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
119 lines (102 loc) · 3.47 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
var Encore = require('@symfony/webpack-encore');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const 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('exercise', './assets/js/exercise.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()
.enableVueLoader()
.autoProvidejQuery()
.copyFiles([
{
from: './node_modules/multiselect-two-sides/dist/js',
pattern: /(multiselect.js)$/,
to: 'libs/multiselect-two-sides/dist/js/multiselect.js'
},
{
from: './node_modules/pwstrength-bootstrap/dist/',
pattern: /(pwstrength-bootstrap.js)$/,
to: 'libs/pwstrength-bootstrap/dist/pwstrength-bootstrap.js'
},
{
from: './node_modules/readmore-js',
pattern: /(readmore.js)$/,
to: 'libs/readmore-js/readmore.js'
},
{
from: './node_modules/js-cookie/src/',
pattern: /(js.cookie.js)$/,
to: 'libs/js-cookie/src/js.cookie.js'
},
{
from: './node_modules/mathjax/',
pattern: /(MathJax.js)$/,
to: 'libs/mathjax/MathJax.js'
},
])
;
Encore.addPlugin(new CopyWebpackPlugin([
{
from: './node_modules/mediaelement/build',
to: 'libs/mediaelement'
},
{
from: './node_modules/mediaelement-plugins/dist',
to: 'libs/mediaelement/plugins'
},
{
from: './node_modules/mathjax/config',
to: 'libs/mathjax/config'
},
]));
// Encore.addPlugin(new copyWebpackPlugin([{
// from: 'assets/css/themes/' + theme + '/images',
// to: 'css/themes/' + theme + '/images'
// };
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 languages 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();