mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-12 13:34:48 +00:00
Re-introduce file used by Karma
This commit is contained in:
parent
1fcf84b348
commit
8a17631780
50
webpack.config.cjs
Normal file
50
webpack.config.cjs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
const webpack = require("webpack");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
mode: "development",
|
||||||
|
entry: {
|
||||||
|
"js-waku": "./src/index.ts",
|
||||||
|
},
|
||||||
|
devtool: "inline-source-map",
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(js|tsx?)$/,
|
||||||
|
use: "ts-loader",
|
||||||
|
exclude: /(node_modules)|(node\.spec\.ts)/,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /node\.spec\.ts$/,
|
||||||
|
use: "ignore-loader",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.ProvidePlugin({
|
||||||
|
process: "process/browser.js",
|
||||||
|
Buffer: ["buffer", "Buffer"],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
extensions: [".ts", ".js"],
|
||||||
|
fallback: {
|
||||||
|
buffer: require.resolve("buffer/"),
|
||||||
|
crypto: false,
|
||||||
|
stream: require.resolve("stream-browserify"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: "[name].js",
|
||||||
|
path: path.resolve(__dirname, "build/umd"),
|
||||||
|
library: "jswaku",
|
||||||
|
libraryTarget: "umd",
|
||||||
|
globalObject: "this",
|
||||||
|
},
|
||||||
|
optimization: {
|
||||||
|
splitChunks: {
|
||||||
|
name: "vendors",
|
||||||
|
chunks: "all",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user