mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-24 06:19:22 +00:00
Add webpack
This commit is contained in:
parent
cc730eca90
commit
8848665525
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
node_modules
|
||||
dist
|
||||
dist
|
||||
build
|
3635
package-lock.json
generated
3635
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,8 @@
|
||||
"typescript": "^3.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.12.8"
|
||||
"@types/node": "^12.12.8",
|
||||
"ts-loader": "^6.0.3",
|
||||
"webpack": "^4.41.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"outDir": "dist",
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
}
|
32
webpack.config.js
Normal file
32
webpack.config.js
Normal file
@ -0,0 +1,32 @@
|
||||
const path = require("path");
|
||||
|
||||
const {
|
||||
NODE_ENV = 'production'
|
||||
} = process.env;
|
||||
|
||||
module.exports = {
|
||||
entry: './src/main.ts',
|
||||
mode: NODE_ENV,
|
||||
target: 'node',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'build'),
|
||||
filename: 'index.js'
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: [
|
||||
'ts-loader'
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
watch: NODE_ENV === 'development'
|
||||
}
|
Loading…
Reference in New Issue
Block a user