A tool to start a server with Webpack. support hot module replacement and build.
🏠 Homepage
✨ Example
Global
npm i @ftbjs/service -g
Local
npm i @ftbjs/service -D
ftbjs create <your project name>
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"
},
...
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')
}
}
}
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
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2020 biyuqiwan@163.com.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator