Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not copy QRCode images when building blog-utils lib #10956

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions webpack-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion webpack.blog-utils.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down