@mese/builder
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@mese/builder

打包器。

命令行使用

$ mese-build --mode=production --meseConfigUrl=mese.config.js --outputPath=dist

# 或者
$ mese-watch --mode=development --meseConfigUrl=mese.config.js --outputPath=dist

API

builder.build

const path = require("path");
const builder = require("@mese/builder");
const [mode, meseConfigUrl, outputPath] = [
  "production",
  path.join(__dirname, "mese.config.js"),
  path.join(__dirname, "dist"),
];
const config = getWebpackConfig({ mode, meseConfigUrl, outputPath });
builder.build(config, function (err, stats) {
  // TODO 处理
});

builder.watch

const path = require("path");
const builder = require("@mese/builder");
const [mode, meseConfigUrl, outputPath] = [
  "production",
  path.join(__dirname, "mese.config.js"),
  path.join(__dirname, "dist"),
];
const config = getWebpackConfig({ mode, meseConfigUrl, outputPath });
builder.watch(config, (err, stats, watching) => {
  // TODO 处理
});

Links

处理错误和 stats 对象,阅读下面的文档,

Readme

Keywords

none

Package Sidebar

Install

npm i @mese/builder

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

30.5 kB

Total Files

29

Last publish

Collaborators

  • erye