mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +00:00
cc675e54ff
- enable source maps for main process - run main and build process using the same command - change dev command to `yarn dev`
24 lines
625 B
JavaScript
24 lines
625 B
JavaScript
import fs from 'fs';
|
|
|
|
/**
|
|
* source: https://github.com/evanw/esbuild/issues/1685#issuecomment-944916409
|
|
* @type {import('esbuild').Plugin}
|
|
*/
|
|
export const excludeVendorFromSourceMap = {
|
|
name: 'excludeVendorFromSourceMap',
|
|
setup(build) {
|
|
build.onLoad({ filter: /node_modules/ }, (args) => {
|
|
if (args.path.endsWith('.json')) {
|
|
return;
|
|
}
|
|
|
|
return {
|
|
contents:
|
|
fs.readFileSync(args.path, 'utf8') +
|
|
'\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==',
|
|
loader: 'default',
|
|
};
|
|
});
|
|
},
|
|
};
|