This repository has been archived by the owner on Dec 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
123b487
commit adde2ca
Showing
8 changed files
with
841 additions
and
88 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const webpack = require("webpack"); | ||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); | ||
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | ||
|
||
const commonConfig = { | ||
mode: "production", | ||
entry: "./src/index.ts", | ||
devtool: "source-map", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.tsx?$/, | ||
use: "ts-loader", | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: [".tsx", ".ts", ".js"], | ||
plugins: [new TsconfigPathsPlugin()], | ||
}, | ||
plugins: [ | ||
new webpack.IgnorePlugin({ | ||
resourceRegExp: | ||
/wordlists\/(french|spanish|italian|korean|chinese_simplified|chinese_traditional|japanese)\.json$/, | ||
}), | ||
], | ||
}; | ||
|
||
const webConfig = { | ||
...commonConfig, | ||
target: "web", | ||
output: { | ||
filename: "bundle.js", | ||
libraryTarget: "umd", | ||
library: "CosmWasmJS", | ||
}, | ||
resolve: { | ||
...commonConfig.resolve, | ||
fallback: { | ||
stream: require.resolve("stream-browserify"), | ||
buffer: require.resolve("buffer"), | ||
path: require.resolve("path-browserify"), | ||
}, | ||
}, | ||
plugins: [ | ||
...commonConfig.plugins, | ||
new webpack.ProvidePlugin({ | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
new webpack.ProvidePlugin({ | ||
process: "process/browser", | ||
}), | ||
], | ||
}; | ||
|
||
const nodeConfig = { | ||
...commonConfig, | ||
target: "node", | ||
output: { | ||
libraryTarget: "commonjs", | ||
filename: "bundle.node.js", | ||
}, | ||
}; | ||
|
||
module.exports = [webConfig, nodeConfig]; |
Oops, something went wrong.