@amalsr/bootstrap-contact-form
Version:
A Bootstrap-based contact form widget for React, Next.js, and raw HTML via <script>.
40 lines (37 loc) • 811 B
JavaScript
const path = require('path');
module.exports = [
// ✅ UMD build for HTML usage
{
entry: './src/rendor.js', // ✅ Use same unified entry with `render()` function for HTML
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.umd.js',
library: {
name: 'ContactFormWidget',
type: 'umd',
},
globalObject: 'this',
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
module: {
rules: [
{
test: /\.jsx?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
extensions: ['.js', '.jsx'],
},
mode: 'production',
},
];