Skip to content

Latest commit

 

History

History
100 lines (53 loc) · 2.55 KB

developer-guide.md

File metadata and controls

100 lines (53 loc) · 2.55 KB

Developer Guide

@femessage/create-nuxt-app is a framework-template scaffolding that use SAO under the hood.

Please check out saojs.org to know what is SAO.

Table of Contents

Add module

Add Jest for example

Add module files

Add module files to template/frameworks

Add the module for framework-template

Then modify the template.config.js which framework-template need to use the module.

Modify the generator/Template.js to make this module be a default module, it will be apply to all framework-template.

Testing generated framework-template

Run create-nuxt-app -t single -o release will be generated to workspace/release.

Check the generated framework-template.

cd release to enter the folder then run these following:

  • yarn
  • yarn build

Check is build succeed.

Check is the new feature works.

Update Test Snapshots

If this module pass your test and feeling good, then run yarn test:snapshot to update the snapshots.

⬆ Back to Top

Add framework-template

Add mobile command for example

Add a new template

Add a mobile template config in template.config.js, it uses vant-ui under the hood.

Template exclusive files, organized in the standalone folder. e.g. framework/mobile

For reusable modules, please check out Add module

⬆ Back to Top

Using the same file

Facing problem: a template uses element-ui for the desktop-side but another template uses vant-ui for the mobile-side.

Add vant-ui module:

Add vant-ui as a dependency to template/_package.json. If the project uses vant-ui and no longer requires element-ui.

Modify the template/nuxt/nuxt.config.js

👋 your lovely template is ready to work with you.

⬆ Back to Top

Links

⬆ Back to Top