代码拉取完成,页面将自动刷新
import path from 'path';
import { fileURLToPath } from 'url';
import TerserPlugin from 'terser-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default () => ({
entry: {
'github-public': './github-public',
'gitlab-public': './gitlab-public',
'bitbucket-public': './bitbucket-public',
gitee: './providers/gitee',
background: './background',
'detect-enterprise': './detect-enterprise'
},
output: {
filename: 'jetbrains-toolbox-[name].js',
path: path.resolve(__dirname, `dist/${process.env.BROWSER}`),
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader'
},
{
test: /\.svg$/,
type: 'asset/inline'
}
]
},
optimization: {
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
mangle: false,
compress: {
defaults: false,
unused: true,
arguments: true,
booleans: false,
expression: false,
sequences: false,
/* eslint-disable camelcase */
join_vars: false,
keep_classnames: true,
keep_fnames: true
/* eslint-enable camelcase */
},
format: {
beautify: true,
comments: false,
/* eslint-disable camelcase */
indent_level: 2
/* eslint-enable camelcase */
}
}
})
]
},
plugins: [
new NodePolyfillPlugin({
includeAliases: ['url', 'process']
}),
new CopyWebpackPlugin({
patterns: [
{from: 'manifest.json', context: `manifests/${process.env.BROWSER}/`},
{from: 'icons/*'},
{from: 'pages/*'},
{from: 'popups/*'},
{from: 'providers/**/assets/*'},
{from: 'styles/*'}
]
})
]
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。