добавляет симлинк
This commit is contained in:
parent
74eaf9b8f9
commit
ee9527214f
5
.gitignore
vendored
5
.gitignore
vendored
@ -127,4 +127,7 @@ dist
|
|||||||
.yarn/unplugged
|
.yarn/unplugged
|
||||||
.yarn/build-state.yml
|
.yarn/build-state.yml
|
||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
.pnp.*
|
.pnp.*
|
||||||
|
|
||||||
|
# Симлинк
|
||||||
|
src/notes
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prestart": "",
|
"prestart": "node ./scripts/symlink.js",
|
||||||
"start": "npx @11t/eleventy --serve",
|
"start": "npx @11t/eleventy --serve",
|
||||||
"build": "cross-env NODE_ENV=production npx @11t/eleventy",
|
"build": "cross-env NODE_ENV=production npx @11t/eleventy",
|
||||||
"stylelint": "stylelint 'src/**/*.css'",
|
"stylelint": "stylelint 'src/**/*.css'",
|
||||||
|
13
scripts/symlink.js
Normal file
13
scripts/symlink.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const process = require('process')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const notesSymlink = path.join(process.cwd(), 'src/notes')
|
||||||
|
|
||||||
|
if (!fs.existsSync(notesSymlink)) {
|
||||||
|
fs.symlinkSync(
|
||||||
|
path.join(process.cwd(), '../content/notes'),
|
||||||
|
notesSymlink,
|
||||||
|
'junction'
|
||||||
|
)
|
||||||
|
}
|
Reference in New Issue
Block a user