1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-08 23:07:32 +02:00
Files
joplin/packages/server/webpack.config.js
Laurent Cozic 810ae1f763 fix hljs config
2022-05-26 16:49:06 +01:00

36 lines
1.1 KiB
JavaScript

const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './dist/utils/e2ee/index.js',
devtool: 'source-map',
mode: 'production',
output: {
path: path.resolve(__dirname, 'public', 'js'),
filename: 'bundle_e2ee.js',
},
resolve: {
fallback: {
'events': require.resolve('events/'),
'url': require.resolve('url/'),
},
},
externals: {
// SJCL is designed to work both in Node and the browser, thus it has
// conditional likes "if crypto is undefined, require('crypto')". That
// works fine in the browser, but WebPack see the "require()" statement
// and then ask to include polyfills, but we don't need this (since
// crypto, etc. are available in the browser). As a result we define
// them as "external" here.
'crypto': 'commonjs crypto',
'stream': 'commonjs stream',
// Exclude locales because it's a lot of files and they aren't used
'./locales/index.js': 'commonjs locales',
},
plugins: [
// https://github.com/moment/moment/issues/2416
new webpack.IgnorePlugin({ resourceRegExp: /^\.\/locale$/, contextRegExp: /moment$/ }),
],
};