We are developing an application using aurelia + webpack. We have installed source-map-loader but we are getting an error during the webpack build process. The error is showing that "module parse failed" for each source map files. When we exclude the aurelia bundle from the webpack, it works as expected.
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"
}
],
}
We are getting following error in the webpack task runner