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>
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
const Encore = require('@symfony/webpack-encore');
|
|
const pluginName = 'elasticsearch';
|
|
|
|
const getConfig = (pluginName, type) => {
|
|
Encore.reset();
|
|
|
|
Encore
|
|
.setOutputPath(`public/build/bitbag/${pluginName}/${type}/`)
|
|
.setPublicPath(`/build/bitbag/${pluginName}/${type}/`)
|
|
.addEntry(`bitbag-${pluginName}-${type}`, path.resolve(__dirname, `./src/Resources/assets/${type}/entry.js`))
|
|
.disableSingleRuntimeChunk()
|
|
.cleanupOutputBeforeBuild()
|
|
.enableSourceMaps(!Encore.isProduction())
|
|
.enableSassLoader();
|
|
|
|
const config = Encore.getWebpackConfig();
|
|
config.name = `bitbag-${pluginName}-${type}`;
|
|
|
|
return config;
|
|
}
|
|
|
|
Encore
|
|
.setOutputPath(`src/Resources/public/`)
|
|
.setPublicPath(`/public/`)
|
|
.addEntry(`bitbag-${pluginName}-shop`, path.resolve(__dirname, `./src/Resources/assets/shop/entry.js`))
|
|
.addEntry(`bitbag-${pluginName}-admin`, path.resolve(__dirname, `./src/Resources/assets/admin/entry.js`))
|
|
.cleanupOutputBeforeBuild()
|
|
.disableSingleRuntimeChunk()
|
|
.enableSassLoader();
|
|
|
|
const distConfig = Encore.getWebpackConfig();
|
|
distConfig.name = `bitbag-plugin-dist`;
|
|
|
|
Encore.reset();
|
|
|
|
const shopConfig = getConfig(pluginName, 'shop')
|
|
const adminConfig = getConfig(pluginName, 'admin')
|
|
|
|
module.exports = [shopConfig, adminConfig, distConfig];
|