Open
Conversation
Signed-off-by: dc-nikolaev <dnikolaev@37bytes.com>
Signed-off-by: dc-nikolaev <dnikolaev@37bytes.com>
dc-nikolaev
reviewed
Feb 9, 2024
Collaborator
There was a problem hiding this comment.
Почему rollup? Заголовок, команды установки.
А в Usage @37bytes/vite-
| @@ -0,0 +1,44 @@ | |||
| [//]: # (todo: уточнить название по конвенции) | |||
| @@ -0,0 +1,17 @@ | |||
| import { describe, expect, test } from '@jest/globals'; | |||
Collaborator
There was a problem hiding this comment.
jest? предлагаю перейти на vitest
| import { join } from 'node:path'; | ||
|
|
||
| describe('generate script', () => { | ||
| const path = join(process.cwd(), '__tests__/.env.test'); |
Collaborator
There was a problem hiding this comment.
Мне кажется, тут фикстуры нужны.
__fixtures__/.env.test вместо __tests__/.env.test
| import { join } from 'node:path'; | ||
|
|
||
| describe('get env variables from file', () => { | ||
| const path = join(process.cwd(), '__tests__/.env.test'); |
Collaborator
There was a problem hiding this comment.
__fixtures__/.env.test вместо __tests__/.env.test
| import { writeFileSync } from 'node:fs'; | ||
| import { join, resolve } from 'node:path'; | ||
|
|
||
| export const handleWriteBundle = ({ logger, forceEnvironmentScriptContent, outDir }) => { |
Collaborator
There was a problem hiding this comment.
Не нужно выносить из тела плагина
| @@ -0,0 +1,7 @@ | |||
| export const handleTransformIndexHtml = ({ html, scriptLink }) => { | |||
Collaborator
There was a problem hiding this comment.
Не нужно выносить из тела плагина
|
|
||
| const createRequestHandler = ({ ignorePrefixes, envConfig, envDir }) => { | ||
| return (request, response) => { | ||
| console.warn('---------------------------'); |
Collaborator
There was a problem hiding this comment.
console.warn можно удалить, это артефакт разработки
| @@ -0,0 +1,6 @@ | |||
| // Генерирует js-строку, содержащую замороженный объект с переменными окружения | |||
| const generateScript = (environment: object) => ` | |||
| // import dotenv from "dotenv"; | ||
| import { readFileSync } from 'node:fs'; | ||
|
|
||
| const dotenv = require('dotenv'); |
Collaborator
There was a problem hiding this comment.
Предлагаю не смешивать import и require
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.