Skip to content

Commit

Permalink
fix sourcemap and remove node source plugin config
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed Mar 6, 2021
1 parent 943ce35 commit 7fdaa12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 1 addition & 19 deletions packages/xarc-webpack/src/partials/node.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */

import { loadXarcOptions } from "../util/load-xarc-options";
const { logger } = require("@xarc/app-dev/lib/logger");

module.exports = function(options) {
const xarcOptions = loadXarcOptions();
const config = options.currentConfig;

if (
process.env.NODE_ENV === "production" &&
config.target === undefined &&
xarcOptions.webpack.enableNodeSourcePlugin !== true
) {
logger.info("Disabling NodeSourcePlugin for production");
return { node: false };
} else {
logger.info(`Not disabling NodeSourcePlugin. NODE_ENV: '${process.env.NODE_ENV}'`);
return {};
}
return {};
};
2 changes: 1 addition & 1 deletion packages/xarc-webpack/src/partials/sourcemaps-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function() {
plugins: [
new SourceMapDevToolPlugin({
filename: "../map/[file].map",
append: `\n//# sourceMappingURL=/map/[url]`
append: `\n//# sourceMappingURL=../[url]`
})
]
};
Expand Down

0 comments on commit 7fdaa12

Please sign in to comment.