Improve bundling
This commit is contained in:
parent
e6766fff42
commit
b0814b1b97
1 changed files with 7 additions and 15 deletions
|
|
@ -2,24 +2,11 @@ const path = require("path");
|
||||||
|
|
||||||
module.exports = (_env, _argv) => ({
|
module.exports = (_env, _argv) => ({
|
||||||
entry: "./src/index.ts",
|
entry: "./src/index.ts",
|
||||||
devtool: "source-map",
|
|
||||||
target: "node",
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
use: [
|
use: ["ts-loader"]
|
||||||
{
|
|
||||||
loader: "ts-loader",
|
|
||||||
options: {
|
|
||||||
compilerOptions: {
|
|
||||||
declaration: true,
|
|
||||||
declarationDir: "./dist/types"
|
|
||||||
},
|
|
||||||
transpileOnly: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.wasm$/,
|
test: /\.wasm$/,
|
||||||
|
|
@ -28,18 +15,23 @@ module.exports = (_env, _argv) => ({
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
// the consuming project should take care of minification
|
||||||
minimize: false
|
minimize: false
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".js"],
|
extensions: [".ts"],
|
||||||
alias: {
|
alias: {
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
src: path.resolve(__dirname, "src")
|
src: path.resolve(__dirname, "src")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
performance: {
|
||||||
|
hints: false // it's a library, no need to warn about its size
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
clean: true,
|
clean: true,
|
||||||
filename: "index.js",
|
filename: "index.js",
|
||||||
|
globalObject: "this",
|
||||||
library: {
|
library: {
|
||||||
name: "SyncClient",
|
name: "SyncClient",
|
||||||
type: "umd"
|
type: "umd"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue