- Change yarn vesrion:
yarn set version berry - Install dependencies:
yarn add -D babel-types nunjucks parcel-bundler parcel-plugin-data-src parcel-plugin-nunjucks parcel-plugin-svg-sprite sass - Run dev:
yarn start
Last active
March 30, 2021 20:28
-
-
Save alsolovyev/d8701baf98ef24fd68f02b7ebb2472c1 to your computer and use it in GitHub Desktop.
Parcel config files for nunjucks templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| 'data': `$isDev: ${process.env.NODE_ENV === 'development'}`, | |
| 'includePaths': ['node_modules'] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Distribution folder | |
| dist/ | |
| # Yarn 2 | |
| .yarn/ | |
| .pnp.js | |
| .yarnrc.yml | |
| # Dependency directories | |
| node_modules/ | |
| # Logs | |
| logs | |
| *.log | |
| npm-debug.log* | |
| yarn-debug.log* | |
| yarn-error.log* | |
| lerna-debug.log* | |
| # Diagnostic reports | |
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const data = require('./src/data') | |
| module.exports = { | |
| root: './src', | |
| data: { | |
| ...data, | |
| isDev: process.env.NODE_ENV === 'development' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "private": true, | |
| "scripts": { | |
| "start": "yarn dev", | |
| "dev": "parcel ./src/index.njk --port 8080 --cache-dir /mnt/d/Junk/parcel-cache", | |
| "clean": "yarn clean:cache", | |
| "clean:cache": "rm -rf /mnt/d/Junk/parcel-cache" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment