Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const exportTemplate = template(`
exports.REMOTE = LOCAL;
`);
/**
* Flags the exported module as a transpiled ES module. Needs to be kept in 1:1
* compatibility with Babel.
*/
const esModuleExportTemplate = template(`
Object.defineProperty(exports, '__esModule', {value: true});
`);
/**
* Resolution template in case it is requested.
*/
const resolveTemplate = template.expression(`
require.resolve(NODE)
`);
/**
* Enforces the resolution of a path to a fully-qualified one, if set.
*/
function resolvePath(node: {value: string, ...}, resolve: boolean) {
if (!resolve) {
return node;
}
return resolveTemplate({
NODE: node,
});
}
const fs = require('fs');
const path = require('path');
const t = require('@babel/types');
const template = require('@babel/template').default;
const syntaxJsx = require('@babel/plugin-syntax-jsx').default;
const {addDefault} = require('@babel/helper-module-imports');
const {stripIndent} = require('common-tags');
const stringHash = require('string-hash');
const utils = require('@reshadow/utils');
const {KEYS} = require('@reshadow/core');
const buildClassName = template.expression(`
NAME.${KEYS.__styles__}["ELEMENT"]
`);
const toObjectExpression = obj =>
t.objectExpression(
Object.entries(obj).map(([key, value]) =>
t.objectProperty(
t.stringLiteral(key),
t.templateLiteral(
[
t.templateElement({
raw: value,
cooked: value,
}),
],
[],
const fs = require('fs');
const path = require('path');
const t = require('@babel/types');
const template = require('@babel/template').default;
const syntaxJsx = require('@babel/plugin-syntax-jsx').default;
const {addDefault} = require('@babel/helper-module-imports');
const {stripIndent} = require('common-tags');
const stringHash = require('string-hash');
const utils = require('@reshadow/utils');
const reshadowPostcss = require('./postcss');
const buildClassName = template.expression(`
NAME.styles["ELEMENT"]
`);
const toObjectExpression = obj =>
t.objectExpression(
Object.entries(obj).map(([key, value]) =>
t.objectProperty(
t.stringLiteral(key),
t.templateLiteral(
[
t.templateElement({
raw: value,
cooked: value,
}),
],
[],