mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Add "hugo mod npm pack"
This commit also introduces a convention where these common JS config files, including `package.hugo.json`, gets mounted into: ``` assets/_jsconfig ´`` These files mapped to their real filename will be added to the environment when running PostCSS, Babel etc., so you can do `process.env.HUGO_FILE_TAILWIND_CONFIG_JS` to resolve the real filename. But do note that `assets` is a composite/union filesystem, so if your config file is not meant to be overridden, name them something specific. This commit also adds adds `workDir/node_modules` to `NODE_PATH` and `HUGO_WORKDIR` to the env when running the JS tools above. Fixes #7644 Fixes #7656 Fixes #7675
This commit is contained in:
@@ -26,6 +26,13 @@ import (
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
const (
|
||||
// The NPM package.json "template" file.
|
||||
FilenamePackageHugoJSON = "package.hugo.json"
|
||||
// The NPM package file.
|
||||
FilenamePackageJSON = "package.json"
|
||||
)
|
||||
|
||||
var (
|
||||
// This should be the only list of valid extensions for content files.
|
||||
contentFileExtensions = []string{
|
||||
@@ -163,9 +170,12 @@ const (
|
||||
ComponentFolderI18n = "i18n"
|
||||
|
||||
FolderResources = "resources"
|
||||
FolderJSConfig = "_jsconfig" // Mounted below /assets with postcss.config.js etc.
|
||||
)
|
||||
|
||||
var (
|
||||
JsConfigFolderMountPrefix = filepath.Join(ComponentFolderAssets, FolderJSConfig)
|
||||
|
||||
ComponentFolders = []string{
|
||||
ComponentFolderArchetypes,
|
||||
ComponentFolderStatic,
|
||||
|
Reference in New Issue
Block a user