Fix config

This commit is contained in:
a.bouhuolia
2021-04-03 20:57:25 +02:00
parent 4c38fb006a
commit df1ecc6d25
2 changed files with 79 additions and 1 deletions

View File

@@ -91,9 +91,11 @@
"mocha": "^5.2.0",
"module-alias": "^2.2.2",
"nyc": "^14.1.1",
"regenerator-runtime": "^0.13.7",
"sinon": "^7.4.2",
"ts-node": "^9.0.0",
"typedi": "^0.8.0",
"typescript": "^3.9.7"
"typescript": "^3.9.7",
"webpack-cli": "^4.6.0"
}
}

76
server/webpack.config.js Normal file
View File

@@ -0,0 +1,76 @@
const path = require('path');
const {
NODE_ENV = 'production',
} = process.env;
// const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: [
// 'regenerator-runtime/runtime',
'./src/server.ts',
],
mode: NODE_ENV,
target: 'node',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'index.js'
},
// externals: [nodeExternals()],
resolve: {
// preferRelative: true,
extensions: ['.ts', '.js'],
alias: {
'loaders': path.resolve(__dirname, 'src/loaders'),
'services': path.resolve(__dirname, 'src/services'),
'collection': path.resolve(__dirname, 'src/collection'),
'config': path.resolve(__dirname, 'src/config'),
'api': path.resolve(__dirname, 'src/api'),
'data': path.resolve(__dirname, 'src/data'),
'database': path.resolve(__dirname, 'src/database'),
'decorators': path.resolve(__dirname, 'src/decorators'),
'exceptions': path.resolve(__dirname, 'src/exceptions'),
'interfaces': path.resolve(__dirname, 'src/interfaces'),
'jobs': path.resolve(__dirname, 'src/jobs'),
'lib': path.resolve(__dirname, 'src/lib'),
'utils': path.resolve(__dirname, 'src/utils'),
'locales': path.resolve(__dirname, 'src/locales'),
'models': path.resolve(__dirname, 'src/models'),
'repositories': path.resolve(__dirname, 'src/repositories'),
'services': path.resolve(__dirname, 'src/services'),
'subscribers': path.resolve(__dirname, 'src/subscribers'),
'system': path.resolve(__dirname, 'src/system'),
//
//
//
//
//
//
//
}
},
module: {
rules: [{
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
test: /\.ts?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
],
}]
}
}