1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-24 06:19:22 +00:00

Add webpack

This commit is contained in:
Pierre HUBERT 2019-11-21 17:04:15 +01:00
parent cc730eca90
commit 8848665525
8 changed files with 3677 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules
dist
build

2
build.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
webpack

3635
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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"
}
}

2
run.sh
View File

@ -1,2 +0,0 @@
#!/bin/bash
npm run-script run

View File

@ -1,14 +1,6 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist",
"sourceMap": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
}

2
watch.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
NODE_ENV=development webpack

32
webpack.config.js Normal file
View 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'
}