Giter Site home page Giter Site logo

Comments (3)

inxilpro avatar inxilpro commented on July 29, 2024 2

The 2.2.1 release should fix this.

from node-app-root-path.

inxilpro avatar inxilpro commented on July 29, 2024

Do you get that error when trying to build with webpack? Or when you're running the script?

from node-app-root-path.

balazskoti avatar balazskoti commented on July 29, 2024

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.

from node-app-root-path.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.