[ci] yarn format
This commit is contained in:
parent
e316c9578c
commit
bf6aab7427
5 changed files with 10 additions and 16 deletions
|
@ -181,7 +181,7 @@ Astro aims to be compatible with multiple JavaScript runtimes in the future. Thi
|
|||
|
||||
Due to that, you cannot use Node modules that you're familiar with such as `fs` and `path`. Our aim is to provide alternative built in to Astro. If you're use case is not covered please let us know.
|
||||
|
||||
However, if you *really* need to use these builtin modules we don't want to stop you. Node supports the `node:` prefix for importing builtins, and this is also supported by Astro. If you want to read a file, for example, you can do so like this:
|
||||
However, if you _really_ need to use these builtin modules we don't want to stop you. Node supports the `node:` prefix for importing builtins, and this is also supported by Astro. If you want to read a file, for example, you can do so like this:
|
||||
|
||||
```jsx
|
||||
---
|
||||
|
@ -193,3 +193,4 @@ const data = JSON.parse(json);
|
|||
---
|
||||
|
||||
<span>Version: {data.version}</span>
|
||||
```
|
||||
|
|
|
@ -18,13 +18,7 @@ const isAstroRenderer = (name: string) => {
|
|||
|
||||
// These packages should NOT be built by `esinstall`
|
||||
// But might not be explicit dependencies of `astro`
|
||||
const denyList = [
|
||||
'prismjs/components/index.js',
|
||||
'@vue/server-renderer',
|
||||
'@astrojs/markdown-support',
|
||||
'node:fs/promises',
|
||||
...nodeBuiltinsMap.values()
|
||||
];
|
||||
const denyList = ['prismjs/components/index.js', '@vue/server-renderer', '@astrojs/markdown-support', 'node:fs/promises', ...nodeBuiltinsMap.values()];
|
||||
|
||||
export default Object.keys(pkg.dependencies)
|
||||
// Filter out packages that should be loaded threw Snowpack
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import { builtinModules } from 'module';
|
||||
|
||||
export const nodeBuiltinsSet = new Set(builtinModules);
|
||||
export const nodeBuiltinsMap = new Map(builtinModules.map(bareName => [bareName, 'node:' + bareName]));
|
||||
export const nodeBuiltinsMap = new Map(builtinModules.map((bareName) => [bareName, 'node:' + bareName]));
|
||||
|
|
|
@ -391,8 +391,8 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
|
|||
external: snowpackExternals,
|
||||
},
|
||||
alias: {
|
||||
...Object.fromEntries(nodeBuiltinsMap)
|
||||
}
|
||||
...Object.fromEntries(nodeBuiltinsMap),
|
||||
},
|
||||
});
|
||||
|
||||
snowpack = await startSnowpackServer(
|
||||
|
|
Loading…
Reference in a new issue