Skip to content

Commit 38eb4ab

Browse files
committed
fix imports
1 parent 2d5a69e commit 38eb4ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

npm/npm-resume-new-article.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ if(!componentName.startsWith("Article")) {
4242
// Create files...
4343
const jsxContent = makeArticleComponent(componentName, slug)
4444
fileUtils.createFile(articlesDir, jsxPath, jsxContent)
45-
fileUtils.createFile(articlesDir, scssPath, `@import "/src/styles/extend.scss";`)
45+
fileUtils.createFile(articlesDir, scssPath, `@import "../styles/extend.scss";`)
4646
logger.log(logger.LogTypes.SUCCESS, `Successfully created article: ${componentName}`)
4747

4848
// Inject into SectionBody.jsx
4949
const sectionBodyPath = path.resolve("src/components/sections/SectionBody.jsx")
5050
let sectionBodyContent = fs.readFileSync(sectionBodyPath, "utf8")
5151

5252
// 1. Add import
53-
const importStatement = `import ${componentName} from "/src/components/articles/${componentName}.jsx"`
53+
const importStatement = `import ${componentName} from "../components/articles/${componentName}.jsx"`
5454
if (!sectionBodyContent.includes(importStatement)) {
5555
const importRegex = /import ArticleNotFound from .+?\n/
5656
sectionBodyContent = sectionBodyContent.replace(importRegex, match => `${match}${importStatement}\n`)

0 commit comments

Comments
 (0)