Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
process(src, filePath) {
// Set default module name and namespace value for the namespace because it can't be properly guessed from the path
const { code, map } = lwcCompiler.transformSync(src, filePath, {
name: 'test',
namespace: 'x',
outputConfig: {
sourcemap: true,
},
});
// if is not .js, we add the .compiled extension in the sourcemap
const filename = path.extname(filePath) === '.js' ? filePath : filePath + '.compiled';
// **Note: .html and .css don't return valid sourcemaps cause they are used for rollup
const config = map && map.version ? { inputSourceMap: map } : {};
return babelCore.transform(code, { ...BABEL_CONFIG, ...config, filename });
},
getCacheKey(fileData, filePath, configStr, options) {
process(src, filePath) {
// Set default module name and namespace value for the namespace because it can't be properly guessed from the path
const { code, map } = lwcCompiler.transformSync(src, filePath, {
moduleName: 'test',
moduleNamespace: 'x',
outputConfig: {
sourcemap: true,
},
});
// if is not .js, we add the .compiled extension in the sourcemap
const filename = path.extname(filePath) === '.js' ? filePath : filePath + '.compiled';
// **Note: .html and .css don't return valid sourcemaps cause they are used for rollup
const config = map && map.version ? { inputSourceMap: map } : {};
return babelCore.transform(code, { ...BABEL_CONFIG, ...config, filename });
},
getCacheKey(fileData, filePath, configStr, options) {