Skip to content

ftbjs/ftb-service

Repository files navigation

Welcome to ftb-service 👋

Version Documentation Maintenance License: MIT Last Commit

A tool to start a server with Webpack. support hot module replacement and build.

Install

Global

npm i @ftbjs/service -g

Local

npm i @ftbjs/service -D

Create Template Quickly

ftbjs create <your project name>

Usage

Global

// start a local serve
ftbjs serve

// build project
ftbjs build

// visualize size of webpack output files
ftbjs build --analyzer

Local

Add below code in your project's package.json

...
"scripts": {
  "dev": "ftbjs serve",
  "build": "ftbjs build",
  "analyzer": "ftbjs build --analyzer"
},
...

ftb.config.js

module.exports = {
  devServer: {
    port: 2021,
    open: true
  },
  packages: true, // for build library need to set it as true
  chainWebpack: config => {
    if (process.env.NODE_ENV === 'production') {
      config.output.filename('my-test.min.js').library('MyTest').libraryTarget('umd')
    }
  }
}

Required

You need to have a src folder. and its has a index.js file. then run the ftbjs serve or ftbjs build. For more information please see Example

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 biyuqiwan@163.com.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator