Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function reconfigureStylable(config) {
const stylablePlugin = new StylableWebpackPlugin({
outputCSS: false,
filename: '[name].stylable.bundle.css',
includeCSSInJS: true,
optimize: { classNameOptimizations: false, shortNamespaces: false },
runtimeMode: 'shared',
globalRuntimeId: '__stylable_yoshi__',
generate: {
runtimeStylesheetId: 'namespace',
},
resolveNamespace: resolveNamespaceFactory(project.name),
// resolveNamespace: (namespace) => namespace + 'TPA',
transformHooks: {
postProcessor: stylableResult => {
autoprefixProcessor.process(stylableResult.meta.outputAst).sync();
return stylableResult;
},
},
});
//remove previous stylable config and attach new one
config.plugins.pop();
config.plugins.push(stylablePlugin);
return config;
}
const { resolveNamespaceFactory } = require('@stylable/node');
const project = require('yoshi-config');
require('yoshi-helpers/require-hooks').setupRequireHooks();
require('@stylable/node').attachHook({
stylableConfig: {
resolveNamespace: resolveNamespaceFactory(project.name),
},
});
const path = require('path');
const fs = require('fs');
const svgr = require('@svgr/core');
const babelCore = require('@babel/core');
require.extensions['.svg'] = mockSvg;
require.extensions['.scss'] = mockScss;
function mockScss(module) {
module.exports = {
default: '',
};
}