UNPKG

@cocreate/webpack

Version:

A Webpack integration tool for CoCreate applications, enabling file watching, automated chunking, lazy loading, and file uploading. It leverages CoCreate.config for streamlined project builds and development workflows.

24 lines (21 loc) 830 B
module.exports = function (source) { let modifiedSource = source.replace(/\$'/g, '\\u0024\''); // console.log("Modified source code:", modifiedSource); return modifiedSource; // const specialChars = /[\0\x08\x09\x1a\n\r"'\\\%\$]/g; // Add or remove characters based on your needs // const replacements = { // // "\0": "\\0", // // "\x08": "\\b", // // "\x09": "\\t", // // "\x1a": "\\z", // // "\n": "\\n", // // "\r": "\\r", // // "\"": "\\\"", // // "'": "\\'", // // "\\": "\\\\", // // "%": "\\%", // "$": "\\$" // Escape for MongoDB and others // // ... add more replacements as needed for other databases // }; // return source.replace(specialChars, (char) => (replacements[char] || char)); };