Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Unable to bundle node_modules with webpack #1125

Closed
euberdeveloper opened this issue Feb 11, 2019 · 2 comments
Closed

Unable to bundle node_modules with webpack #1125

euberdeveloper opened this issue Feb 11, 2019 · 2 comments

Comments

@euberdeveloper
Copy link

Bug Report

What is the expected behavior?

Everything should be bundled in the dist folder, with two dirs (browser and server) and a file (server.js).
I should be able to have only this folder to run my server and serve the pages, without have the weight of node_modules

What is the current behavior?

I got an error when I lunch the server:

Cannot find module '../lib/utils.js'
    at Function.webpackEmptyContext [as resolve] (

The only way I found to resolve the problem is change to externals with this on the webpack configuration:

var nodeExternals = require('webpack-node-externals');

module.exports = {
     externals: [nodeExternals()], //Old value was /node_modules/
     //The rest of the conf
}

The problem is that to run the express server I need also the node_modules folder, and it weights.

@CaerusKaru
Copy link
Member

Duplicate of angular/angular-cli#8616

@CaerusKaru CaerusKaru marked this as a duplicate of angular/angular-cli#8616 Feb 11, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants