2021-10-11 04:03:13 +00:00
|
|
|
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: /\.ts$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
process: 'process/browser.js',
|
|
|
|
Buffer: ['buffer', 'Buffer'],
|
|
|
|
})
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js'],
|
|
|
|
fallback: {
|
|
|
|
buffer: require.resolve('buffer/'),
|
2022-05-09 13:32:43 +00:00
|
|
|
crypto: false,
|
2021-10-11 04:03:13 +00:00
|
|
|
stream: require.resolve('stream-browserify'),
|
|
|
|
assert: require.resolve('assert'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: '[name].bundle.js',
|
|
|
|
path: path.resolve(__dirname, 'build/umd'),
|
|
|
|
library: 'jswaku',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
globalObject: 'this',
|
|
|
|
}
|
|
|
|
};
|