Skip to content

Commit

Permalink
fix(@angular/cli): revert following @clydin comments
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed May 27, 2017
1 parent 8fec989 commit 8fcd402
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 0 additions & 5 deletions packages/@angular/cli/custom-typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,3 @@ interface IWebpackDevServerConfigurationOptions {
public?: string;
disableHostCheck?: boolean;
}


interface NodeModule {
paths: string[];
}
11 changes: 5 additions & 6 deletions packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
const { projectRoot, buildOptions, appConfig } = wco;

const appRoot = path.resolve(projectRoot, appConfig.root);
const projectRootNodeModules = path.resolve(projectRoot, 'node_modules');
const nodeModules = module.paths.slice(0, module.paths.indexOf(projectRootNodeModules) + 1);
const nodeModules = path.resolve(projectRoot, 'node_modules');

let extraPlugins: any[] = [];
let extraRules: any[] = [];
Expand Down Expand Up @@ -68,12 +67,12 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
devtool: buildOptions.sourcemaps ? 'source-map' : false,
resolve: {
extensions: ['.ts', '.js'],
modules: [appRoot, 'node_modules', projectRootNodeModules],
modules: ['node_modules', nodeModules],
},
resolveLoader: {
modules: nodeModules
modules: [nodeModules, 'node_modules']
},
context: projectRoot,
context: __dirname,
entry: entryPoints,
output: {
path: path.resolve(projectRoot, buildOptions.outputPath),
Expand All @@ -83,7 +82,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
},
module: {
rules: [
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: nodeModules },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: [nodeModules] },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.(eot|svg)$/, loader: `file-loader?name=[name]${hashFormat.file}.[ext]` },
Expand Down

0 comments on commit 8fcd402

Please sign in to comment.