mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-18 03:45:02 +03:00
Webpack / ESM
This commit is contained in:
26
webpack.config.js
Normal file
26
webpack.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const path = require("path");
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return {
|
||||
entry: {
|
||||
index: path.resolve(__dirname, "./lib/esm/index.js")
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "./lib/umd"), // builds to ./lib/umd/
|
||||
filename: "[name].js", // index.js
|
||||
library: "orionprotocol", // aka window.myLibrary
|
||||
libraryTarget: "umd", // supports commonjs, amd and web browsers
|
||||
globalObject: "this"
|
||||
},
|
||||
module: {
|
||||
rules: [{ test: /\.t|js$/, use: "babel-loader" }]
|
||||
},
|
||||
resolve: {
|
||||
fallback: {
|
||||
"crypto": require.resolve("crypto-browserify"),
|
||||
"buffer": require.resolve("buffer/"),
|
||||
"stream": require.resolve("stream-browserify"),
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user