imod
Last updated 7 years ago by haozime .
MIT · Bugs · Original npm · Tarball · package.json
$ npm install imod 
SYNC missed versions from official npm registry.

iMod


1. Install

yarn global add imod
# or
sudo npm install imod -g

2. Showcase

create a new project:

imod init ./hello

with an existing project:

add these into package.json

{
  "main": "dist/index.js",
  "module": "dist/index.mjs",
  "types": "dist/types/index.d.ts",
  "scripts": {
    "build": "imod build",
    "dev": "imod dev"
  }
}

with cli

imod dev
imod build

with JavaScript

import Imod from 'imod'
const iMod = new IMod({
  cwd: __dirname + '/../..'
})

iMod.build()
iMod.dev()

create an example:

imod init ./hello --templateName=module --lite=true # If you don't use '--lite', it will try to install node_modules

3. Advanced configuration

  • you can add a config at package.json, ./imod.config.js, ./imod.config.json, ./imodconfig.js, ./imodconfig.json
  • The order in which imod looks up is ./imod.config.js -> ./imod.config.json -> imodconfig.js -> imodconfig.json -> ${package.json}.config.imod

this is the default configuration:

module.exports = {
  name: moduleName, // if not set, will guess from ${package.json}.name
  banner: '', // if not set, return ''
  input: '', // string | string[] | null. if not set, will find src/index*{.ts,.tsx,.js,.jsx,.es6,.es,.mjs}
  outDir: '', // string. default is './dist'
  declarationDir: false,  // string | false. if false will no typings
  compilerOptions: [
    {
      format: 'esm',
      extName: '.mjs',
      target: 'esnext'
    },
    {
      format: 'cjs',
      extName: '.js',
      target: 'es5'
    },
    {
      format: 'umd',
      extName: '.min.js',
      target: 'es5'
    }
  ]
}

Current Tags

  • 1.5.0                                ...           latest (7 years ago)

29 Versions

  • 1.5.0                                ...           7 years ago
  • 1.4.2                                ...           7 years ago
  • 1.4.1                                ...           7 years ago
  • 1.4.0                                ...           7 years ago
  • 1.3.4                                ...           7 years ago
  • 1.3.3                                ...           7 years ago
  • 1.3.2                                ...           7 years ago
  • 1.3.1                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.5                                ...           7 years ago
  • 1.2.4                                ...           7 years ago
  • 1.2.3                                ...           7 years ago
  • 1.2.1                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.8                                ...           7 years ago
  • 1.1.7                                ...           7 years ago
  • 1.1.6                                ...           7 years ago
  • 1.1.5                                ...           7 years ago
  • 1.1.4                                ...           7 years ago
  • 1.1.3                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 1.0.0-beta.1                                ...           7 years ago
  • 1.0.0-beta.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (9)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE