-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.config.js
108 lines (92 loc) · 3.6 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
( function () {
var Encore = require( '@symfony/webpack-encore' ),
CopyWebpackPlugin = require( 'copy-webpack-plugin' );
Encore
// Directory where compiled assets will be stored.
.setOutputPath( './public/assets/' )
// Public URL path used by the web server to access the output path.
.setPublicPath( '/assets/' )
// Set up global variables.
.autoProvideVariables( {
OO: 'oojs'
} )
// Copy i18n files for use by jquery.i18n.
.addPlugin( new CopyWebpackPlugin( {
patterns: [
{ from: './node_modules/jquery.uls/i18n/', to: 'i18n/jquery.uls/' },
{ from: './i18n/', to: 'i18n/app/' }
]
} ) )
// Add extra loader for OOUI's *.cur cursor image files.
.addLoader( { test: /\.cur$/, loader: 'file-loader' } )
// Remove deprecated options from css-loader.
// @TODO remove this after the options have been removed from Encore defaults.
.configureCssLoader( function ( options ) {
delete options.minimize;
delete options.sourceMap;
return options;
} )
/*
* ENTRY CONFIG
*
* Add 1 entry for each "page" of your app
* (including one that's included on every page - e.g. "app")
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if you JavaScript imports CSS.
*/
.addEntry( 'app', [
// JQuery.
'./assets/jqueryinit.js',
// OOJS.
'./node_modules/oojs/dist/oojs.js',
// OOJS-UI.
'./node_modules/oojs-ui/dist/oojs-ui.js',
'./node_modules/oojs-ui/dist/oojs-ui-wikimediaui.js',
'./node_modules/oojs-ui/dist/oojs-ui-core-wikimediaui.css',
'./node_modules/oojs-ui/dist/oojs-ui-widgets-wikimediaui.css',
'./node_modules/oojs-ui/dist/oojs-ui-windows-wikimediaui.css',
'./node_modules/oojs-ui/dist/oojs-ui-wikimediaui-icons-interactions.css',
'./node_modules/oojs-ui/dist/oojs-ui-wikimediaui-icons-wikimedia.css',
// jQuery i18n.
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.js',
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.messagestore.js',
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.fallbacks.js',
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.parser.js',
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.emitter.js',
'./node_modules/@wikimedia/jquery.i18n/src/jquery.i18n.language.js',
'./node_modules/@wikimedia/jquery.i18n/src/languages/he.js',
'./node_modules/@wikimedia/jquery.i18n/src/languages/fi.js',
'./node_modules/@wikimedia/jquery.i18n/src/languages/ml.js',
// Universal Language Selector.
'./node_modules/jquery.uls/src/jquery.uls.data.js',
'./node_modules/jquery.uls/src/jquery.uls.data.utils.js',
'./node_modules/jquery.uls/src/jquery.uls.lcd.js',
'./node_modules/jquery.uls/src/jquery.uls.languagefilter.js',
'./node_modules/jquery.uls/src/jquery.uls.core.js',
'./node_modules/jquery.uls/css/jquery.uls.css',
'./node_modules/jquery.uls/css/jquery.uls.grid.css',
'./node_modules/jquery.uls/css/jquery.uls.lcd.css',
// Leaflet.
'./node_modules/leaflet/dist/leaflet.js',
'./node_modules/leaflet/dist/leaflet.css',
// This app.
'./assets/app.js',
'./assets/app.less',
'./assets/search.less',
'./assets/translate.js',
'./assets/translate.less',
'./assets/InterfaceLangButton.js',
'./assets/LanguageDialog.js',
'./assets/SearchWidget.js',
'./assets/UlsTagMultiselectWidget.js'
] )
// Other options.
.enableLessLoader()
.cleanupOutputBeforeBuild()
.disableSingleRuntimeChunk()
.enableSourceMaps( !Encore.isProduction() )
.enableVersioning( Encore.isProduction() );
// eslint-disable-next-line no-undef
module.exports = Encore.getWebpackConfig();
}() );