node.js - Getting "Module not found" error -
when run angular 2 project using
npm start
i had error this. using webpack in project. webpack
const path = require('path'); const webpack = require('webpack'); const nodeexternals = require('webpack-node-externals'); module.exports = { entry: { server: './src/server.ts' }, resolve: { extensions: ['.ts', '.js'] }, target: 'node', plugins: [ new webpack.normalmodulereplacementplugin(/\.\.\/environments\/environment/, '../environments/environment.prod') ], externals: [nodeexternals({ whitelist: [ /^ng2-timeout/ ] })], node: { __dirname: true }, output: { path: path.join(__dirname, 'dist'), filename: '[name].js' }, module: { rules: [ { test: /\.ts$/, loader: 'ts-loader' } ] } }
fixed issue removing code webpack file
plugins: [ new webpack.normalmodulereplacementplugin(/\.\.\/environments\/environment/, '../environments/environment.prod') ], 
Comments
Post a Comment