-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
54 lines (51 loc) · 1.43 KB
/
webpack.config.js
File metadata and controls
54 lines (51 loc) · 1.43 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
const Encore = require('@symfony/webpack-encore');
const StyleLintPlugin = require('stylelint-webpack-plugin');
Encore
.setOutputPath('Resources/public/')
.enableLessLoader(function(options) {
options.relativeUrls = true;
})
.setPublicPath('/public')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enablePostCssLoader(function(options) {
options.config = {
path: './postcss.config.js'
};
})
.addEntry('js/main', [
'./assets/js/main.js'
])
.addStyleEntry('css/main', [
'./assets/less/main.less'
])
.addStyleEntry('css/carousel', [
'./assets/less/carousel.less'
])
.addLoader(
{
test: /\.(eot|svg|svgz|ico|ttf)([?]?.*)$/,
loader: 'file-loader'
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url-loader?limit=10000&mimetype=application/font-woff'
}
)
.addLoader({
enforce: 'pre',
test: /\.jsx?$/,
exclude: /(node_modules|var\/)/,
loader: 'eslint-loader',
options: {
cache: true
}
})
.addPlugin(new StyleLintPlugin({
files: ['assets/less/**/*.less']
}));
module.exports = Encore.getWebpackConfig();