-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
47 lines (46 loc) · 1.23 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const path = require("path");
//const TypescriptDeclarationPlugin = require("typescript-declaration-webpack-plugin");
// 現在rollup.jsでコンパイルしているが、型ファイルを一つにまとめたいので、一応残しておく
// NPM モジュールとして公開されない範囲
var main = {
mode: "development",
//target: "web",
target: "node",
entry: path.join(__dirname, "src", "main"),
output: {
library: "SaaSus",
libraryTarget: "umd",
filename: "saasus-sdk.js",
path: path.resolve(__dirname, "dist"),
globalObject: "this", //self doesn't work in node.js
},
node: {
__dirname: false,
__filename: false,
},
module: {
rules: [
{
test: /.ts?$/,
include: [
path.resolve(__dirname, "src"),
path.resolve(__dirname, "src/modules"),
path.resolve(__dirname, "generated"),
],
exclude: [path.resolve(__dirname, "node_modules")],
loader: "ts-loader",
},
],
},
resolve: {
extensions: [".js", ".ts"],
preferRelative: true,
},
// plugins: [
// new TypescriptDeclarationPlugin({
// removeComments: false,
// out: "saasus-sdk.d.ts",
// }),
// ],
};
module.exports = [main];