Allows to use .targetables.js
for PWAStudio
const { ExtendLocalIntercept } = require('@larsroettig/component-targetables');
function localIntercept(targets) {
const { Targetables } = require('@magento/pwa-buildpack');
const targetables = Targetables.using(targets);
const extendLocalIntercept = new ExtendLocalIntercept(targetables);
extendLocalIntercept.allowCustomTargetables();
extendLocalIntercept.allowCssOverwrites();
}
module.exports = localIntercept;
Big shoutout to Chris Brabender for this blog post https://dev.to/chrisbrabender/simplifying-targetables-in-pwa-studio-p8b
▸ allowCssOverwrites(targetablesSearchPaths?
, fileExtendsion?
, magentoPath?
): void
Name | Type | Default value |
---|---|---|
fileExtendsion |
string |
'*.module.css' |
targetablesSearchPaths |
string[] |
['src/components', 'src/RootComponents'] |
magentoPath |
string |
'node_modules/@magento' |
void
▸ allowCustomTargetables(targetablesSearchPaths?
, fileExtendsion?
, magentoPath?
): void
Allows to place a custome targetable with given matching filepattern.
Name | Type | Default value |
---|---|---|
fileExtendsion |
string |
'*.targetables.js' |
targetablesSearchPaths |
string[] |
['src/components', 'src/RootComponents'] |
magentoPath |
string |
'node_modules/@magento' |
void
https://github.com/larsroettig/demo-component-targetables