Answer the question
In order to leave comments, you need to log in
css file not being created why?
let path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const conf = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist/'),
filename: 'main.js',
publicPath: 'dist/',
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
// exclude: '/node_modules/'
},
{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
esModule: true,
}
},
'style-loader','css-loader'
]
}
]
},
plugins: [new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
})],
}
module.exports = (env,options) => {
let production = options.mode === 'production';
conf.devtool = production ? 'source-map' : 'eval-soursemap'
return conf
}
Answer the question
In order to leave comments, you need to log in
Problem solved for Divi theme. The header.php file contains two search forms: the first as a module (I have line 151), the second as a header element (I have line 320). The problem was that I was making changes to the module line. After staging
<input type="hidden" name="post_type" value="product" />
in the header element, the problem was solved.
In the theme search file (searchform.php) add
<input type="hidden" name="post_type" value="product">
As an option, replace the output of the standard search with a woocommerce search
or write a function in the functions.php file
function search_product($query) {
if ($query->is_search) {
$query->set('post_type', 'product');
}
return $query;
}
add_action('pre_get_posts','search_product');
Tell me, did you manage to solve this problem? Also interested in this question, the same situation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question