mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: remove babel
This commit is contained in:
1 parent
ff943b620e
commit
c7c70a6abb
23 files changed
+466
-606
No files matched your search
@@ -1,16 +1,16 @@
|
||||
import astyleBinaryUrl from 'wastyle/dist/astyle-optimize-size.wasm';
|
||||
|
||||
export default async function load() {
|
||||
const { init, format } = await import('wastyle');
|
||||
try {
|
||||
await init(astyleBinaryUrl);
|
||||
console.log('WAstyle is ready!');
|
||||
const formatter = (code, options) => {
|
||||
const [success, result] = format(code, options);
|
||||
return [success, (result || '').replace(/^#(include|import)[\t ]*(<|")/gm, (match, p1, p2) => `#${p1} ${p2}`)];
|
||||
};
|
||||
return [true, formatter];
|
||||
} catch (e) {
|
||||
return [false, e.message];
|
||||
}
|
||||
const { init, format } = await import('wastyle');
|
||||
try {
|
||||
await init(astyleBinaryUrl);
|
||||
console.log('WAstyle is ready!');
|
||||
const formatter = (code, options) => {
|
||||
const [success, result] = format(code, options);
|
||||
return [success, (result || '').replace(/^#(include|import)[\t ]*(<|")/gm, (match, p1, p2) => `#${p1} ${p2}`)];
|
||||
};
|
||||
return [true, formatter];
|
||||
} catch (e) {
|
||||
return [false, e.message];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user