Spaces:
Running
Running
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
entry: './igvcomponent.js', // Your main JavaScript file | |
output: { | |
filename: 'main.js', // The output file | |
path: path.resolve(__dirname, 'build'), // Directory for the build | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, // Apply Babel to JavaScript files | |
exclude: /node_modules/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
presets: ['@babel/preset-env', '@babel/preset-react'] // Presets for React and modern JavaScript | |
} | |
} | |
} | |
] | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
title: 'IGV Component', // Title for your HTML file | |
}), | |
], | |
}; | |