forked from asdoria/AsdoriaSyliusQuickShoppingPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
49 lines (38 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
46
47
48
49
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const fs = require('fs');
const basePath = path.resolve(__dirname, './');
const assets_path = path.join(basePath, './src/Resources/private');
const output_path = path.join(basePath, './src/Resources/public');
const public_path = 'bundles/asdoriasyliusquickshoppingplugin';
const sass_path = path.join(assets_path, './scss');
const js_path = path.join(assets_path, './js');
const isProduction = Encore.isProduction();
Encore
// empty the outputPath dir cd ../before each build
.cleanupOutputBeforeBuild()
// directory where all compiled assets will be stored
.setOutputPath(output_path)
.setPublicPath('/' + public_path)
.setManifestKeyPrefix(public_path)
.addEntry('shop-quick-shopping', [
path.join(js_path, './shop.js'),
path.join(sass_path, './shop.scss'),
])
// allow sass/scss files to be processed
.enableSassLoader()
.enablePostCssLoader()
.autoProvidejQuery()
// allow legacy applications to use $/jQuery as a global variable
// .autoProvidejQuery()
.enableSourceMaps(!isProduction)
.disableSingleRuntimeChunk()
// create hashed filenames (e.g. app.abc123.css)
.enableVersioning(false)
.configureFilenames({
js: '[name].min.js',
css: '[name].min.css',
})
;
config = Encore.getWebpackConfig();
module.exports = config;