Do not copy QRCode images when building blog-utils lib (#10956)
This commit is contained in:
Родитель
896a3b1b21
Коммит
22b231fcbb
|
@ -120,7 +120,10 @@ export function getRules({
|
|||
];
|
||||
}
|
||||
|
||||
export function getPlugins({ withBrowserWindow = true } = {}) {
|
||||
export function getPlugins({
|
||||
withBrowserWindow = true,
|
||||
withQRCodes = true,
|
||||
} = {}) {
|
||||
const clientConfig = getClientConfig(config);
|
||||
|
||||
const plugins = [
|
||||
|
@ -146,22 +149,27 @@ export function getPlugins({ withBrowserWindow = true } = {}) {
|
|||
/locale$/,
|
||||
new RegExp(`^\\.\\/.*?\\/amo\\.js$`),
|
||||
),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(
|
||||
__dirname,
|
||||
'src',
|
||||
'amo',
|
||||
'components',
|
||||
'AddonQRCode',
|
||||
'img',
|
||||
),
|
||||
},
|
||||
],
|
||||
}),
|
||||
];
|
||||
|
||||
if (withQRCodes) {
|
||||
plugins.push(
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(
|
||||
__dirname,
|
||||
'src',
|
||||
'amo',
|
||||
'components',
|
||||
'AddonQRCode',
|
||||
'img',
|
||||
),
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (withBrowserWindow) {
|
||||
plugins.push(
|
||||
// This swaps the server side window object with a standard browser
|
||||
|
|
|
@ -30,7 +30,7 @@ const makeConfig = ({ target, externals = {} }) => ({
|
|||
rules: getRules({ fileLimit: 20000 }),
|
||||
},
|
||||
plugins: [
|
||||
...getPlugins({ withBrowserWindow: target === 'web' }),
|
||||
...getPlugins({ withBrowserWindow: target === 'web', withQRCodes: false }),
|
||||
new webpack.NormalModuleReplacementPlugin(
|
||||
/amo\/tracking/,
|
||||
'blog-utils/tracking.js',
|
||||
|
|
Загрузка…
Ссылка в новой задаче