-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
executable file
·52 lines (38 loc) · 1.39 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
const Encore = require('@symfony/webpack-encore')
const path = require('path')
const basePath = path.resolve(__dirname, './');
const assetsPath = path.join(basePath, './src/Resources/private')
const outputPath = path.join(basePath, './src/Resources/public')
const publicPath = 'bundles/asdoriasyliuspickuppointplugin'
const cssPath = path.join(assetsPath, './css')
const jsPath = path.join(assetsPath, './js')
Encore
.cleanupOutputBeforeBuild()
.setOutputPath(outputPath)
.setPublicPath('/' + publicPath)
.setManifestKeyPrefix(publicPath)
.addEntry('asdoria-pickup-point', [
path.join(jsPath, './app.js'),
path.join(cssPath, './app.scss'),
])
.enableSassLoader()
// .disableSingleRuntimeChunk()
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
// .splitEntryChunks()
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSourceMaps(!Encore.isProduction())
.disableSingleRuntimeChunk()
.enableVersioning(Encore.isProduction())
.configureFilenames({
js: 'js/[name].min.js',
css: 'css/[name].min.css',
})
;
const config = Encore.getWebpackConfig()
// config.watchOptions = {
// poll: true,
// ignored: /node_modules/
// }
// export the final configuration
module.exports = config