Answer the question
In order to leave comments, you need to log in
How to allow libraries to be included in a specific path for node_modules via webpack2?
In my ui-util directory, webpack is launched with the key source=
path_to_resources_webpack.config.js
config.entry = {
'polyfills': `${SOURCE}/polyfills.ts`,
'vendor': `${SOURCE}/vendor.ts`,
'app': `${SOURCE}//main.ts`
};
import {enableProdMode} from "@angular/core";
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
config.resolve = {
extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html'],
modules: [
path.resolve(__dirname, "node_modules"),
]
};
.
├── app
│ ├── app.component.html
│ ├── app.component.scss
│ ├── app.component.ts
│ ├── app.module.ts
│ └── directives
│ └── materialize-select.directive.ts
├── main.ts
├── polyfills.ts
├── settings.json
└── vendor.ts
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.component.ts:1:81
Cannot find module '@angular/core'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.component.ts:2:50
Cannot find module '@angular/forms'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.module.ts:1:24
Cannot find module '@angular/core'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.module.ts:2:29
Cannot find module '@angular/platform-browser'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.module.ts:3:26
Cannot find module '@angular/http'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/app.module.ts:4:48
Cannot find module '@angular/forms'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/app/directives/materialize-select.directive.ts:1:59
Cannot find module '@angular/core'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/main.ts:1:30
Cannot find module '@angular/core'.
ERROR in [at-loader] ../auth/src/main/resources/webapp/source/main.ts:2:38
Cannot find module '@angular/platform-browser-dynamic'.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question