-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
45 lines (41 loc) · 1.34 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
var Encore = require('@symfony/webpack-encore');
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
// Convert typescript files.
.enableTypeScriptLoader()
.enableLessLoader()
.addStyleEntry('global', [
'./public/scss/application.scss',
'./vendor/surfnet/stepup-bundle/src/Resources/public/less/stepup.less'
])
.addEntry('submitonload', './public/typescript/submitonload.ts')
.addEntry('app', './public/typescript/app.ts')
// Convert sass files.
.enableSassLoader(function (options) {
options.sassOptions = {
outputStyle: 'expanded',
includePaths: ['public'],
};
})
.addLoader({test: /\.scss$/, loader: 'webpack-import-glob-loader'})
.addLoader({
test: /\.tsx?|\.js$/,
exclude: /node_modules|vendor/,
use: [{
loader: 'eslint-loader',
options: {
configFile: 'eslint.json',
emitErrors: true,
failOnHint: Encore.isProduction(),
typeCheck: true
}
}]
})
.enableSingleRuntimeChunk()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
;
module.exports = Encore.getWebpackConfig();