Closed balazskoti closed 5 years ago
Do you get that error when trying to build with webpack? Or when you're running the script?
While trying to run the build with webpack. This is my webpack config:
const path = require('path');
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
const webpack = require("webpack");
module.exports = function(env, args){
/*SOME LOGIC HERE*/
// final config
return {
target: "node",
entry: './src/init.ts',
node: {
__dirname: true
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: [/node_modules/]
}
]
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
// https://github.com/NodeRedis/node_redis/issues/790
'hiredis': path.join(__dirname, 'aliases/hiredis.js')
}
},
optimization: {
minimize: false
},
plugins: [
// replace environment file
new webpack.NormalModuleReplacementPlugin(/(.*)environments\/environment(\.*)/, function(resource) {
resource.request = resource.request.replace(/environments\/environment/, `environments/environment.${appProfile}`);
}),
//ignore the drivers you don't want. This is the complete list of all drivers -- remove the suppressions for drivers you want to use.
new FilterWarningsPlugin({
exclude: [/mongodb/, /*/mssql/,*/ /mysql/, /mysql2/, /oracledb/, /pg/, /pg-native/, /pg-query-stream/, /redis/, /sqlite3/]
})
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
}
};
};
Btw, I'm looking at typeorm's package json which looks for "app-root-path": "^2.0.1",
which looks like it has disappeared from NPM.
The 2.2.1
release should fix this.
Commit b20b622c20bf9f78b8ab06f9020935843f9a8cc3 broke TypeORM webpack project. (I think it is not TypeORM specific).
I'm using webpack to build my node/typescript project, I am not using yarn at all.
The
if (process.versions.pnp) {...}
should not activate.