: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const WebpackAssetsManifest = require('webpack-assets-manifest');
const CleanWebpackPlugin = require('clean-webpack-plugin');
* @property {object} [entryChunkName: string] A unique entry ID
* @property {array} entryChunkName.entry - A list of entries to bundle with the library
* @property {string} [entryChunkName.filename] - The target file name (if omitted, the entry entryChunkName will be used
* @property {string} [entryChunkName.var] - The name of the global variable to which the library will be assigned
entry: ['./src/js/otgsSwitcher.js'],
entry: ['./src/js/otgsPopoverTooltip.js'],
'otgsTableStickyHeader': {
entry: ['./src/js/otgsTableStickyHeader.js'],
const getEntries = () => {
Object.keys(libraries).map(key => entries[key] = libraries[key].entry);
const getEntryFileName = (chunk) => {
if (libraries.hasOwnProperty(chunk.id) && libraries[chunk.id].hasOwnProperty('filename') && libraries[chunk.id].filename) {
return libraries[chunk.id].filename;
return path.join(chunk.name);
module.exports = env => {
const isProduction = env === 'production';
console.log('getEntries()', getEntries());
// console.log('getVars()',getVars());
path: path.join(__dirname, 'dist'),
filename: chunkData => path.join('js', getEntryFileName(chunkData.chunk) + '.js?ver=' + chunkData.chunk.hash),
chunkFilename: '[id].[name].js?ver=[chunkhash]',
library: ["OTGSUI", "[name]"],
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
sourceMap: !isProduction,
sourceMap: !isProduction,
loader: 'postcss-loader',
new CleanWebpackPlugin(['dist']),
filename: path.join('css', '[name].css?ver=[chunkhash]'),
new WebpackAssetsManifest({
output: path.join(__dirname, 'dist', 'assets.json'),
devtool: isProduction ? '' : 'inline-source-map'