Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

cannot read property 'exclude' of undefined #393

Open
aqibshehzad opened this issue Mar 14, 2017 · 1 comment
Open

cannot read property 'exclude' of undefined #393

aqibshehzad opened this issue Mar 14, 2017 · 1 comment

Comments

@aqibshehzad
Copy link

Here are my package.json file:

{
"name": "angular-quickstart",
"version": "1.0.0",
"scripts": {
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings",
"ngc": "ngc -p ./tsconfig-aot.json",
"start": "concurrently "webpack-dev-server --hot --inline --port 8080" "dotnet run" ",
"webpack-dev": "set NODE_ENV=development && webpack",
"webpack-production": "set NODE_ENV=production && webpack",
"build-dev": "npm run webpack-dev",
"build-production": "npm run ngc && npm run webpack-production",
"watch-webpack-dev": "set NODE_ENV=development && webpack --watch --color",
"watch-webpack-production": "npm run build-production --watch --color",
"publish-for-iis": "npm run build-production && dotnet publish -c Release"
},
"license": "ISC",
"dependencies": {
"@angular/common": "~2.4.6",
"@angular/compiler": "~2.4.6",
"@angular/core": "~2.4.6",
"@angular/forms": "~2.4.6",
"@angular/http": "~2.4.6",
"@angular/platform-browser": "~2.4.6",
"@angular/platform-browser-dynamic": "~2.4.6",
"@angular/router": "~3.4.6",
"@angular/upgrade": "~2.4.6",
"@types/node": "^7.0.5",
"angular2-in-memory-web-api": "0.0.21",
"bootstrap": "^3.3.6",
"bootstrap-datepicker": "^1.6.4",
"core-js": "^2.4.1",
"ie-shim": "^0.1.0",
"mydatepicker": "0.0.34",
"ng2-bootstrap": "^1.1.5",
"ng2-datepicker": "^1.0.6",
"ng2-datetime": "^1.2.0",
"ng2-popover": "0.0.8",
"raw-loader": "^0.5.1",
"reflect-metadata": "0.1.9",
"rimraf": "^2.6.1",
"rxjs": "^5.2.0",
"sass-loader": "^4.1.1",
"source-map-loader": "^0.1.6",
"style-loader": "^0.13.2",
"systemjs": "0.19.27",
"ts-helpers": "^1.1.2",
"tslint": "^4.5.1",
"tslint-loader": "^3.4.3",
"url-loader": "^0.5.8",
"zone.js": "^0.7.8"
},
"devDependencies": {
"@types/jquery": "^2.0.40",
"awesome-typescript-loader": "2.2.4",
"clean-webpack-plugin": "^0.1.15",
"concurrently": "^2.2.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"file-loader": "^0.9.0",
"html-webpack-plugin": "^2.26.0",
"json-loader": "^0.5.4",
"lite-server": "^2.2.2",
"node-sass": "^4.3.0",
"nouislider": "^9.2.0",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.4",
"sass-loader": "^4.1.1",
"source-map-loader": "^0.1.6",
"style-loader": "^0.13.1",
"ts-helpers": "^1.1.2",
"tslint": "^4.3.1",
"tslint-loader": "^3.3.0",
"typescript": "2.1.1",
"typings": "^1.3.2",
"url-loader": "^0.5.7",
"webpack": "^2.2.1",
"webpack-dev-server": "2.2.1"
},
"-vs-binding": {
"ProjectOpened": [
"watch-webpack-dev"
]
}
}

tsconfig.json

{
"compilerOptions": {
"module": "es2015",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "./Appjs/app",
"skipLibCheck": true,
"lib": [
"es2015",
"dom"
]

},
"files": [
"angularApp/app/app.module.ts",
"angularApp/app/about/about.module.ts",
"angularApp/main.ts"
],
"awesomeTypescriptLoaderOptions": {
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false
}

webpack.dev.js

var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
console.log('@@@@@@@@@ USING DEVELOPMENT @@@@@@@@@@@@@@@');
module.exports = {
devtool: 'source-map',
performance: {
hints: false
},
entry: {
"polyfills": "./Angular2/polyfills.ts",
// "vendor":"./A2/vendor.ts",
"app": "./Angular2/main.ts"
},
output: {
path: "./Views/Home",
filename: '../../angularBundle/[name].[hash].build.js'
},
resolve: {
extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html', '.cshtml'],
modules: [path.resolve(__dirname, './src'), 'node_modules']
},

devServer: {
    historyApiFallback: true,
    contentBase: path.join(__dirname, '/wwwroot/'),
    watchOptions: {
        aggregateTimeout: 300,
        poll: 1000
    }
},
module: {
    rules: [
        {
            test: /\.ts$/,
            loaders: [
                'awesome-typescript-loader',                   
                'source-map-loader',
                'tslint-loader'
            ]
        },
        {
            test: /\.(png|jpg|gif|woff|woff2|ttf|svg|eot)$/,
            loader: 'file-loader?name=assets/[name]-[hash:6].[ext]'
        },
        {
            test: /favicon.ico$/,
            loader: 'file-loader?name=/[name].[ext]'
        },
        {
            test: /\.css$/,
            loader: 'style-loader!css-loader'
        },
        {
            test: /\.scss$/,
            exclude: /node_modules/,
            loaders: ['style-loader', 'css-loader', 'sass-loader']
        },
        {
            test: /\.html$/,
            loader: 'raw-loader'
        }
    ],
    exprContextCritical: false
},
plugins: [
    new CleanWebpackPlugin(
        [
           './angularBundle',
        ]
    ),
      new webpack.optimize.CommonsChunkPlugin({ name: ['app', 'polyfills', /*'vendor'*/] }),
     new webpack.optimize.UglifyJsPlugin({
         compress: {
             warnings: false
         }
     }),
    new HtmlWebpackPlugin({
        template: "./Views/Home/loader",
        filename: "./Index.cshtml",
        inject: false,
    }),

    new CopyWebpackPlugin([
        { from: './a2/images/*.*', to: 'assets/', flatten: true }
    ])
]

};

Please guide me when i run through webpack it give me the subjected error of cannot read property 'exclude' of undefined.

@jasonpang
Copy link

Follow this: #293 (comment)

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