-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
64 lines (57 loc) · 2.31 KB
/
webpack.config.js
File metadata and controls
64 lines (57 loc) · 2.31 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
55
56
57
58
59
60
61
62
63
64
/*
Webpack Encore configuration.
https://github.com/symfony/webpack-encore/blob/master/index.js
https://symfony.com/doc/3.4/frontend/encore/legacy-apps.html
*/
var path = require('path');
var Encore = require('@symfony/webpack-encore');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/js/app.js')
.addEntry('nelmio', './assets/js/nelmio.js')
.addEntry('course_info_layout', './assets/js/course_info_layout.js')
//.splitEntryChunks()
.autoProvidejQuery()
//.enableSingleRuntimeChunk()
.disableSingleRuntimeChunk()
.enableBuildNotifications()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableSassLoader()
.enablePostCssLoader(
/*
(options) => {
options.config = {
// the directory where the postcss.config.js file is stored
path: './assets'
};
}
*/
)
.autoProvideVariables({
$: 'jquery',
jQuery: 'jquery',
select2: 'select2',
bootbox: 'bootbox',
})
.copyFiles([
{from: './assets/images', to: 'images/[path][name].[ext]'},
{from: './node_modules/ckeditor/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
{from: './node_modules/ckeditor/adapters', to: 'ckeditor/adapters/[path][name].[ext]'},
{from: './node_modules/ckeditor/lang', to: 'ckeditor/lang/[path][name].[ext]'},
{from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
{from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'},
{from: './node_modules/ckeditor-wordcount-plugin', to: 'ckeditor/plugins/[path][name].[ext]'}
])
.addLoader({test: /\.json$/i, include: [path.resolve(__dirname, 'node_modules/ckeditor')], loader: 'raw-loader', type: 'javascript/auto'})
;
module.exports = [
Encore.getWebpackConfig()
];