Preparing library for export.

Reconfigured webpack.

Removed unused packages.

Added library exports (webpack configured to export IIFE).

Created showcase directory.
This commit is contained in:
2022-04-17 17:44:52 -05:00
parent 61f9ae82ed
commit ec6ce48988
14 changed files with 6950 additions and 333 deletions

5
showcase/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"cSpell.words": [
"audioshowkit"
]
}

6841
showcase/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
showcase/package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "showcase",
"type": "module",
"version": "1.0.0",
"description": "",
"main": "webpack.common.js",
"scripts": {
"build": "webpack --config webpack.prod.js",
"watch": "webpack serve --config webpack.dev.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^6.7.1",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"style-loader": "^3.3.1",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-merge": "^5.8.0"
}
}

15
showcase/src/index.html Normal file
View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AudioShowKit Showcase</title>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,39 @@
import path from "path";
import HtmlWebpackPlugin from "html-webpack-plugin";
export default {
entry: {
audioshowkit: path.resolve("./src/audioshowkit.js"),
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
}
}
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.html$/i,
loader: "html-loader",
},
]
},
output: {
filename: "[name].js",
path: path.resolve("./dist")
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve("./src/index.html"),
})
]
};

15
showcase/webpack.dev.js Normal file
View File

@@ -0,0 +1,15 @@
import { merge } from "webpack-merge";
import path from "path";
import webpackCommon from "./webpack.common.js";
const devConfig = {
mode: "development",
devtool: "inline-source-map",
devServer: {
static: path.resolve("./dist"),
open: true
}
};
export default merge(webpackCommon, devConfig);

9
showcase/webpack.prod.js Normal file
View File

@@ -0,0 +1,9 @@
import { merge } from "webpack-merge";
import webpackCommon from "./webpack.common.js";
const prodConfig = {
mode: "production",
};
export default merge(webpackCommon, prodConfig);