在Webpack中使用Angular2不会在调试器

时间:2016-10-29 22:07:01

标签: angular typescript webpack

在使用Angular2和Webpack时遇到了一些问题,我们将不胜感激。 当我启动webpack-dev-server时,该站点工作正常。但是,我无法在调试器中看到webpack文件夹(我使用的是Chrome)。 我怀疑这与我的项目目录结构有关,webpack正在寻找文件。

enter image description here

这是我的webpack.config

module.exports = {

entry:  './app/main.ts',

output: {
  path: "./built",
  filename: 'bundle.js',
},

devtool: 'source-map',

 resolve: {
   extensions: ['',  '.ts', '.js']
 },

plugins: [
    new webpack.optimize.UglifyJsPlugin({ })
],

module : {
    loaders: [
        {
            test: /\.ts$/, 
            exclude: /node_modules/,
            loaders: 'ts-loader'
        },
        {
            test: /\.css$/,
            exclude: /node_modules/,
            loaders: 'style!css'
        },
        { 
            test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
            exclude: /node_modules/,
            loader: "url-loader?limit=10000&mimetype=application/font-woff"
        },
        {
            test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
            exclude: /node_modules/,
            loader: "file-loader"
        }
    ]
},

};

这是我的项目目录结构:

enter image description here

当我构建bundle(webpack或webpack-dev-server)时,我最后会收到一些警告。到目前为止,我忽略了这些,但我相信这是一个不同的问题。我把这包括在内容中。

enter image description here

0 个答案:

没有答案
相关问题