webpack

时间:2017-01-09 15:04:03

标签: webpack aurelia source-maps

我们正在使用aurelia + webpack开发应用程序。我们已经安装了source-map-loader,但是我们在webpack构建过程中遇到了错误。错误显示"模块解析失败"对于每个源映射文件。当我们从webpack中排除aurelia包时,它会按预期工作。

的package.json

{

     "dependencies":
     {


         "aurelia-bootstrapper-webpack": "^1.0.0",
            "aurelia-event-aggregator": "^1.0.0",
            "aurelia-framework": "^1.0.1",
            "aurelia-history-browser": "^1.0.0",
            "aurelia-i18n": "^1.1.1",
            "aurelia-loader-webpack": "^1.0.3",
            "aurelia-logging-console": "^1.0.0",
            "aurelia-templating-binding": "^1.0.0",
            "aurelia-templating-resources": "^1.0.0",
            "aurelia-templating-router": "^1.0.0",
            "i18next-xhr-backend": "^1.1.0"

      },



 "devDependencies": {

"@types/node": "^6.0.52",
"aurelia-dialog": "^1.0.0-beta.3.0.1",
"aurelia-webpack-plugin": "^1.1.0",
"bluebird": "^2.9.2",
"bootstrap": "^3.3.7",
"bootstrap-webpack": "0.0.5",
"css-loader": "^0.23.1",
"file-loader": "^0.8.5",
"font-awesome": "^4.7.0",
"html-loader": "^0.4.3",
"less": "^2.6.1",
"less-loader": "^2.2.3",
"raw-loader": "^0.5.1",
"source-map-loader": "^0.1.5",
"style-loader": "^0.13.0",
"toastr": "^2.1.2",
"ts-node": "^1.7.2",
"url-loader": "^0.5.7",
"webpack": "^1.14.0"

  }
}

Webpack.config.js

    'aurelia': [
            'aurelia-bootstrapper-webpack',
            'aurelia-polyfills',
            'aurelia-pal',
            'aurelia-pal-browser',
            'aurelia-binding',
            'aurelia-dialog',
            'aurelia-dependency-injection',
            'aurelia-event-aggregator',
            'aurelia-framework',
            'aurelia-history',
            'aurelia-history-browser',
            'aurelia-loader',
            'aurelia-loader-webpack',
            'aurelia-logging',
            'aurelia-logging-console',
            'aurelia-metadata',
            'aurelia-path',
            'aurelia-route-recognizer',
            'aurelia-router',
            'aurelia-task-queue',
            'aurelia-templating',
            'aurelia-templating-binding',
            'aurelia-templating-router',
            'aurelia-templating-resources'
        ]
    },

    output: {
        //This is the folder where our packed app will be after we run webpack.
        path: './build',
        filename: '[name].bundle.js',
        sourceMapFilename: '[name].bundle.js.map'
    }, 
    devtool: 'source-map', 
    resolve: {
        extensions: ['', '.js']
    }, 
    module: {
        preLoaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                include:/src/,
                loader: "source-map-loader"
            }
        ],

}

我们在webpack任务运行器中遇到以下错误

enter image description here

0 个答案:

没有答案