1.10.0 • Published 3 years ago

@manpacker/noden v1.10.0

Weekly downloads
57
License
MIT
Repository
github
Last release
3 years ago

npm npm bundle size npm NPM nodei.co

Explain

Noden is a set of build engine based on webpack to build engine package. Entry file supported file extension js or ts Support for multi-portal file build, Files must be in the build root directory.

.manpackeric

Project default initialization file, Can be a javascript script file, or a json configuration file. Example: json

{"output": "bin"}

You can also set the manpacker field in the package.json file. Example:

{"manpacker": {"root": "app"}}

Final input result, Merge .manpackeric config item.

{"root": "app", "output": "bin"}

You can customize the project initialization file name. Example: Custom name: development.ic.js

npx manpacker-noden --ci development.ic.js
manpacker-noden --ci development.ic.js

Install

npm i @manpacker/noden -D

Usage

CLI

Start the local development environment.

manpacker-noden server
manpacker-noden server --ic [value] -c [config] --port [number]

Construction of production environment engineering project.

manpacker-noden build
manpacker-noden build --ic [value] -c [config]

API

const noden = require('@manpacker/noden')

method

.compile

Core compilation method

const { compile } = require('@manpacker/noden')
compile({ env, ic, config })
paramtypeexplain
envstringenv: NDOE_ENV variabl
icobject.manpackeric config item object
configfunctionmanpacker.noden.js return funtion

.Commander

Commander is Create command-line class.

const { Commander } = require('@manpacker/noden')

let { version } = require('./package.json')
let commander = new Commander({ version })

Explain commander methods

methodexplain
buildDefault build production environment, enter project directory
serverLaunch Development Environment, Local Interconnect Service, default Port 8090
parseCompile registration command Lint

.createEslintLoader

Create Eslint loader generator.

paramteypeexplain
rgxRegExpCreate eslint loader.

.manpackeric

Default root file name: .manpackeric Configuration item description:

nametypevaluedescription
rootstringdefault: appSource directory for building the project
outputstringdefault: viewDirectory output after build
defineobjectdedalut: {NODE_ENV: process.env.NODE_ENV}Define constants in a project, eslintrc set global key-value
isEslintbooleandefault: trueStart the eslint-loader feature by default
isExternalsDependenciesbooleandefault: falseBuild package dependency package

manpacker.noden.js

Default root file name: manpacker.noden.js

module.exports = ic => {
  // webpack config item.
  return {}
}

The parameter ic is the injected initialization parameter object. Webpack configuration items can be set based on ic

Npm

link