2022-04-17 23:47:24 +00:00
|
|
|
const path = require("path");
|
|
|
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
2022-04-16 08:22:01 +00:00
|
|
|
|
2022-04-17 23:47:24 +00:00
|
|
|
module.exports = {
|
2022-04-15 05:11:46 +00:00
|
|
|
entry: {
|
2022-04-17 23:47:24 +00:00
|
|
|
audioshowkitshowcase: path.resolve("./src/js/main.js"),
|
2022-04-15 05:11:46 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2022-04-16 08:22:01 +00:00
|
|
|
test: /\.m?js$/,
|
|
|
|
exclude: /(node_modules|bower_components)/,
|
|
|
|
use: {
|
|
|
|
loader: "babel-loader",
|
|
|
|
options: {
|
|
|
|
presets: ["@babel/preset-env"]
|
|
|
|
}
|
|
|
|
}
|
2022-04-15 05:11:46 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
2022-04-15 20:34:43 +00:00
|
|
|
use: ["style-loader", "css-loader"],
|
2022-04-16 08:22:01 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html$/i,
|
|
|
|
loader: "html-loader",
|
|
|
|
},
|
2022-04-15 05:11:46 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: "[name].js",
|
2022-04-16 08:22:01 +00:00
|
|
|
path: path.resolve("./dist")
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
2022-04-17 22:44:52 +00:00
|
|
|
template: path.resolve("./src/index.html"),
|
2022-04-17 23:47:24 +00:00
|
|
|
}),
|
|
|
|
new CopyPlugin({
|
|
|
|
patterns: [
|
|
|
|
{ from: "audio/*.mp3", to: "./" }
|
|
|
|
]
|
2022-04-16 08:22:01 +00:00
|
|
|
})
|
|
|
|
]
|
2022-04-15 05:11:46 +00:00
|
|
|
};
|