mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
Enable source map generation in webpack
JS files are minified, enabling source map generation will help with debugging. Sentry can also use source maps for better exceptions.
This commit is contained in:
@@ -6,6 +6,7 @@ const CleanWebpackPlugin = require("clean-webpack-plugin");
|
||||
var config = {
|
||||
cache: true,
|
||||
context: path.resolve(__dirname, "assets/static"),
|
||||
devtool: "cheap-source-map",
|
||||
entry: {
|
||||
unsee: "./unsee.js",
|
||||
help: "./help.js"
|
||||
@@ -37,7 +38,7 @@ var config = {
|
||||
fs.mkdirSync(path.join(__dirname, "assets/static/dist/templates"));
|
||||
for (var chunkName in stats.assetsByChunkName) {
|
||||
var loaderName = "loader_" + chunkName + ".html";
|
||||
var loaderScript = "<script type='text/javascript' src='static/dist/" + stats.assetsByChunkName[chunkName] + "'></script>";
|
||||
var loaderScript = "<script type='text/javascript' src='static/dist/" + stats.assetsByChunkName[chunkName][0] + "'></script>";
|
||||
fs.writeFileSync(path.join(__dirname, "assets/static/dist/templates", loaderName), loaderScript);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user