1.0.9 • Published 2 years ago

free-ground-cli v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

🍦free-ground-cli v1.0.9

集成了 webpack, webpack-dev-server, html-webpack-plugin, 适用于想简单打包, 却不想每次都配置的情况


安装

npm i free-ground-cli --save-dev
或
yarn add free-ground-cli --save-dev

使用

执行 webpack 打包:

npx free

执行 webpack-dev-server 服务:

npx free dev

或者在 package.json 中配置

  ...
  "scripts": {
    "start": "free dev",
    "build": "free"
  },
  ...

然后执行

npm start
npm run build

默认配置

默认入口 src/index.js, 输出 ./dist, html 模板 src/document.ejs

// webpack.config.js

const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
  mode: "development",
  entry: {
    index: "./src/index.js",
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: "./src/document.ejs",
    }),
  ],
  devServer: {
    static: "./dist",
    hot: true,
  },
  output: {
    filename: "[name].bundle.js",
    path: path.resolve("./dist"),
  },
};
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago