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

39 lines
779 B
JavaScript
Raw Normal View History

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'],
},
],
},
};