woocommerce-paypal-payments/modules/ppcp-local-alternative-payment-methods/webpack.config.js
Emili Castells Guasch dd990ca44a Add trustly gateway
2024-08-21 16:24:37 +02:00

60 lines
1.4 KiB
JavaScript

const path = require( 'path' );
const isProduction = process.env.NODE_ENV === 'production';
const DependencyExtractionWebpackPlugin = require( '@woocommerce/dependency-extraction-webpack-plugin' );
module.exports = {
devtool: isProduction ? 'source-map' : 'eval-source-map',
mode: isProduction ? 'production' : 'development',
target: 'web',
plugins: [ new DependencyExtractionWebpackPlugin() ],
entry: {
'bancontact-payment-method': path.resolve(
'./resources/js/bancontact-payment-method.js'
),
'blik-payment-method': path.resolve(
'./resources/js/blik-payment-method.js'
),
'eps-payment-method': path.resolve(
'./resources/js/eps-payment-method.js'
),
'ideal-payment-method': path.resolve(
'./resources/js/ideal-payment-method.js'
),
'mybank-payment-method': path.resolve(
'./resources/js/mybank-payment-method.js'
),
'p24-payment-method': path.resolve(
'./resources/js/p24-payment-method.js'
),
'trustly-payment-method': path.resolve(
'./resources/js/trustly-payment-method.js'
),
},
output: {
path: path.resolve( __dirname, 'assets/' ),
filename: 'js/[name].js',
},
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
{
loader: 'file-loader',
options: {
name: 'css/[name].css',
},
},
{ loader: 'sass-loader' },
],
},
],
},
};