unimal-jp / spear

The spear OSS repository
https://late-cloud-6411.spearly.app
MIT License
10 stars 1 forks source link

Support configuratable directories #146

Closed mantaroh closed 1 year ago

mantaroh commented 1 year ago

What is this?

This change make a Spear to be configuratable directories:
The spear allow the following directory:

setting key of spear.config.mjs value type description
srcDir string array source directory which need to build
componentsDir string array components directory which need to parse and bundle
distDir string destination directory

You need to write these directories into spear.config.mjs.

e.g.,:

export default {
  "spearlyAuthKey": "xxxxxxxxx",
  "projectName": "local-test",
  "generateSitemap": false,
  "srcDir": ["src", "src/components", "src/pages" ],
  "componentsDir": ["src/components"],
  "distDir": "dist",
};

Note

  1. If srcDir include the child directory, spear might remove child directory. (In above sample settings, src/page will be removed.)
  2. If srcDir has the directory which end with components, spear will not remove it even if it's child directory.
    • This reason is that user might generate the component result.