-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
30 lines (29 loc) · 990 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
// entry: './script.js',
entry: './script-sdk.js',
output: {
filename: 'index.js', // Output filename
path: path.resolve(__dirname, 'dist'), // Output directory
clean: true, // Clean the output directory before each build
},
module: {
rules: [
{
test: /\.css$/, // Match .css files
use: [MiniCssExtractPlugin.loader, 'css-loader'], // Use MiniCssExtractPlugin and css-loader
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html', // Use index.html as a template
}),
new MiniCssExtractPlugin({
filename: 'index.css', // Output CSS filename
}),
],
mode: 'development', // Set to 'production' for production builds
};