mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[PCPlugin] Fix various issues in loadStylesheet replacing
This commit is contained in:
parent
2bc4f3cf10
commit
00134f0fe2
1 changed files with 2 additions and 2 deletions
|
@ -22,12 +22,12 @@ export default (manifestPath, repo) => {
|
|||
|
||||
content = content.replace(`module.exports = class`, `export default new class`);
|
||||
content = content.replace(/this\.loadStylesheet\(['"`](.*)['"`]\)/g, (_, relative) => {
|
||||
const path = manifestPath.split('/').slice(0, -1).join('/') + relative;
|
||||
const path = manifestPath.split('/').slice(0, -1).concat('').join('/') + relative;
|
||||
|
||||
let css;
|
||||
|
||||
if (path.split('.').pop() === 'scss') {
|
||||
css = (sass.renderSync({ file: path })).css;
|
||||
css = (sass.renderSync({ file: path })).css.toString('utf8');
|
||||
} else {
|
||||
css = readFileSync(sync);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue