-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
37 lines (33 loc) · 1.05 KB
/
Copy pathwebpack.config.js
File metadata and controls
37 lines (33 loc) · 1.05 KB
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
const path = require('path');
module.exports = {
// モード値を production に設定すると最適化された状態で、
// development に設定するとソースマップ有効でJSファイルが出力される
mode: 'development', // "production" | "development" | "none"
// メインとなるJavaScriptファイル(エントリーポイント)
// entry: './src/index.ts',
entry: './dist/index.js',
output: {
path: path.join(__dirname, "dist"),
filename: "index.js"
},
module: {
rules: [
{
// 拡張子 .ts の場合
test: /\.ts$/,
// TypeScript をコンパイルする
use: 'ts-loader'
}
]
},
// import 文で .ts ファイルを解決するため
resolve: {
modules: [
"node_modules", // node_modules 内も対象とする
],
extensions: [
'.ts',
'.js' // node_modulesのライブラリ読み込みに必要
]
}
};