1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/plugin-repo-cli/webpack.config.js
2021-12-22 11:32:56 +01:00

39 lines
779 B
JavaScript

const path = require('path');
const webpack = require('webpack');
const distDir = path.resolve(__dirname, 'dist');
// To get source maps working:
//
// - Need to add `require('source-map-support').install()` on top of index.ts
// - Set `devtool: 'source-map'`
// - It only works in development mode
// - Need to add the "source-map-loader" rule so that it uses the maps generated
// by TypeScript
module.exports = {
entry: './index.js',
mode: 'development',
target: 'node',
devtool: 'source-map',
output: {
filename: 'index.js',
path: distDir,
},
plugins: [
new webpack.BannerPlugin({
banner: '#!/usr/bin/env node\n',
raw: true,
}),
],
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
},
],
},
};