mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
66 lines
1.5 KiB
JavaScript
66 lines
1.5 KiB
JavaScript
const path = require("path");
|
|
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
|
|
const UnminifiedWebpackPlugin = require("unminified-webpack-plugin");
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
resolve: {
|
|
extensions: [".js", ".ts", ".tsx"]
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"]
|
|
},
|
|
{
|
|
test: /\.(js|ts|tsx)$/,
|
|
exclude: /(node_modules)/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
envName: "library"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
test: /\.(wsz|mp3)$/,
|
|
use: [
|
|
{
|
|
loader: "file-loader",
|
|
options: {
|
|
emitFile: true,
|
|
name: "[path][name]-[hash].[ext]"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
noParse: [/jszip\.js$/]
|
|
},
|
|
plugins: [
|
|
new BundleAnalyzerPlugin({
|
|
analyzerMode: "static",
|
|
reportFilename: "library-report.html",
|
|
openAnalyzer: false
|
|
}),
|
|
// Also generate non-minified bundles.
|
|
new UnminifiedWebpackPlugin()
|
|
],
|
|
performance: {
|
|
// We do some crazy shit okay! Don't judge!
|
|
maxEntrypointSize: 9000000,
|
|
maxAssetSize: 9000000
|
|
},
|
|
entry: {
|
|
"bundle.min": "./js/webamp.js",
|
|
"lazy-bundle.min": "./js/webampLazy.tsx"
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, "../built"),
|
|
filename: "webamp.[name].js",
|
|
library: "Webamp",
|
|
libraryTarget: "umd",
|
|
libraryExport: "default"
|
|
}
|
|
};
|