woocommerce-paypal-payments/modules/ppcp-button/webpack.config.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-04-06 11:16:18 +03:00
const path = require('path');
2020-04-02 08:38:00 +03:00
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
devtool: isProduction ? 'source-map' : 'eval-source-map',
2020-04-02 08:38:00 +03:00
mode: isProduction ? 'production' : 'development',
target: 'web',
entry: {
button: path.resolve('./resources/js/button.js'),
2022-10-20 13:13:42 +03:00
"hosted-fields": path.resolve('./resources/css/hosted-fields.scss'),
"gateway": path.resolve('./resources/css/gateway.scss')
2020-04-02 08:38:00 +03:00
},
output: {
2020-04-06 11:16:18 +03:00
path: path.resolve(__dirname, 'assets/'),
2020-04-02 08:38:00 +03:00
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',
}
2020-04-06 11:16:18 +03:00
},
2020-04-02 08:38:00 +03:00
{loader:'sass-loader'}
]
2020-04-06 11:16:18 +03:00
}]
2020-04-02 08:38:00 +03:00
}
};