mirror of
https://github.com/remotely-save/remotely-save.git
synced 2024-06-07 21:10:45 +00:00
58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
const path = require("path");
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
|
|
module.exports = {
|
|
entry: "./main.ts",
|
|
target: "web",
|
|
output: {
|
|
filename: "main.js",
|
|
path: __dirname,
|
|
libraryTarget: "commonjs",
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: "ts-loader",
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: [".tsx", ".ts", ".js"],
|
|
mainFields: ["module", "main"],
|
|
fallback: {
|
|
assert: require.resolve("assert"),
|
|
buffer: require.resolve("buffer/"),
|
|
console: require.resolve("console-browserify"),
|
|
constants: require.resolve("constants-browserify"),
|
|
crypto: require.resolve("crypto-browserify"),
|
|
domain: require.resolve("domain-browser"),
|
|
events: require.resolve("events"),
|
|
http: require.resolve("stream-http"),
|
|
https: require.resolve("https-browserify"),
|
|
os: require.resolve("os-browserify/browser"),
|
|
path: require.resolve("path-browserify"),
|
|
punycode: require.resolve("punycode"),
|
|
process: require.resolve("process/browser"),
|
|
querystring: require.resolve("querystring-es3"),
|
|
stream: require.resolve("stream-browserify"),
|
|
string_decoder: require.resolve("string_decoder"),
|
|
sys: require.resolve("util"),
|
|
timers: require.resolve("timers-browserify"),
|
|
tty: require.resolve("tty-browserify"),
|
|
url: require.resolve("url"),
|
|
util: require.resolve("util"),
|
|
vm: require.resolve("vm-browserify"),
|
|
zlib: require.resolve("browserify-zlib"),
|
|
},
|
|
},
|
|
externals: {
|
|
obsidian: "commonjs2 obsidian",
|
|
},
|
|
optimization: {
|
|
minimize: true,
|
|
minimizer: [new TerserPlugin({ extractComments: false })],
|
|
},
|
|
};
|