mirror of
https://github.com/jbcr/SyliusElasticsearchPlugin.git
synced 2026-03-24 00:42:08 +01:00
* initial commit * initial commit * not fixed * hot not fix * basic webpack implementation * implement webpack * implement webpack * added fixes and mobile support * deleated package-lock.json * Delete yarn.lock * adding new lines and deleated public build * Change input to symfony form row * GHA fix * GHA fix * Gha fix build->encore * Fix spec ImageTransformer * Gha fix node version changed to 14.x * scrutinizer node fix * scrutinizer node fix * scrutinizer node fix Co-authored-by: kuba-end <kostek660i@gmail.com> Co-authored-by: Tomasz Grochowski <tg@urias.it>
49 lines
1.8 KiB
JavaScript
49 lines
1.8 KiB
JavaScript
const path = require('path');
|
|
const Encore = require('@symfony/webpack-encore');
|
|
|
|
const [bitbagElasticsearchShop, bitbagElasticsearchAdmin] = require('../../webpack.config.js')
|
|
const syliusBundles = path.resolve(__dirname, '../../vendor/sylius/sylius/src/Sylius/Bundle/');
|
|
|
|
const uiBundleScripts = path.resolve(syliusBundles, 'UiBundle/Resources/private/js/');
|
|
const uiBundleResources = path.resolve(syliusBundles, 'UiBundle/Resources/private/');
|
|
|
|
// Shop config
|
|
Encore
|
|
.setOutputPath('public/build/shop/')
|
|
.setPublicPath('/build/shop')
|
|
.addEntry('shop-entry', './assets/shop/entry.js')
|
|
.disableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.enableVersioning(Encore.isProduction())
|
|
.enableSassLoader();
|
|
|
|
const shopConfig = Encore.getWebpackConfig();
|
|
|
|
shopConfig.resolve.alias['sylius/ui'] = uiBundleScripts;
|
|
shopConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources;
|
|
shopConfig.resolve.alias['sylius/bundle'] = syliusBundles;
|
|
shopConfig.name = 'shop';
|
|
|
|
Encore.reset();
|
|
|
|
// Admin config
|
|
Encore
|
|
.setOutputPath('public/build/admin/')
|
|
.setPublicPath('/build/admin')
|
|
.addEntry('admin-entry', './assets/admin/entry.js')
|
|
.disableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.enableVersioning(Encore.isProduction())
|
|
.enableSassLoader();
|
|
|
|
const adminConfig = Encore.getWebpackConfig();
|
|
|
|
adminConfig.resolve.alias['sylius/ui'] = uiBundleScripts;
|
|
adminConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources;
|
|
adminConfig.resolve.alias['sylius/bundle'] = syliusBundles;
|
|
adminConfig.externals = Object.assign({}, adminConfig.externals, { window: 'window', document: 'document' });
|
|
adminConfig.name = 'admin';
|
|
|
|
module.exports = [shopConfig, adminConfig, bitbagElasticsearchShop, bitbagElasticsearchAdmin]; |