Total Pageviews

Thursday 24 October 2024

安装静态网站程序spike

 $ cd ~

$ npm install spike -g  

$ spike new spike-site
▸ adding template "base"
▸ initializing template
? What is the name of your project? spikeblog of brite
? Describe your project it's my blog
? What is your github username? briteming
? Would you like to use whitespace-sensitive syntax? Yes
? Would you like a production config file? Yes
▸ installing production dependencies
✓ project created at C:\Users\12799\spike-site

$ cd spike-site

$ ls
app.js             assets/        package-lock.json  readme.md  views/
app.production.js  node_modules/  package.json       test/

$ spike -h
usage: spike [-h] [-v] {compile,watch,clean,new,template,tpl} ...
an opinionated static build tool, powered by webpack
Positional arguments:
  {compile,watch,clean,new,template,tpl}
    compile             Compile a spike project
    watch               Watch a spike project and compile any time there are
                        changes to a file
    clean               Removes the output directory of a spike project
    new                 Creates a new spike project from a template
    template            Manage spike project templates
Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
 

 $ spike compile

$ ls
app.js             assets/        package-lock.json  public/    test/
app.production.js  node_modules/  package.json       readme.md  views/

(生成了public目录)

$ ls public
css/  index.html  js/ 

$ cd public 

$ python -m http.server 1234



 

 


 


 

No comments:

Post a Comment