hollow-cli
Hollow CLI
Last updated a month ago by nanyuantingfeng .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hollow-cli 
SYNC missed versions from official npm registry.

Build Status

hollow-cli

Base on Webpack 4.x/Babel 7.x/Happypack 5.x /TS 3.x Zero configuration Packaging Tools.

webpack 4.x has been quite well developed, but there is no general configuration to simplify operations. this tool provides a default base configuration for most development situations.

Usage

    npm i -D hollow-cli
    hollow dev -p 9999
    hollow build
    hollow dll
    =======================
    > others :
    > hollow dev -h
    > hollow build -h
// must be provide a entry
// webpack.config.js
module.exports = context => {
  // context.entry = './src/index.js'
  context.entry = {
    index: './src/index.js',
    index2: './src/index2.js'
  }
}

/*   OR : package.json */
;```json
     {
         // "entry" : "./src/index.js"
          "entry" : {
             "index" :"./src/index.js"
             "index2" : "./src/index2.js"
            }
          }
    ```

/** OR :
 *   if you don`t provide "entry",
 *   "entry" is ./example/index.[jt]sx?
 * **/

Default Provider

  • GraphQL [*.graphql, *.gql]

  • Babel [*.js, *.jsx]

    @babel/preset-env

      browsers: ['last 2 versions', 'safari >= 7', 'IE >= 11']
    
    • @babel/preset-react
    • @babel/plugin-external-helpers
    • @babel/plugin-transform-runtime
    • @babel/plugin-transform-object-assign
    • @babel/plugin-syntax-dynamic-import
    • @babel/plugin-syntax-import-meta
    • @babel/plugin-proposal-async-generator-functions
    • @babel/plugin-transform-regenerator
    • @babel/plugin-proposal-decorators :legacy
    • @babel/plugin-proposal-class-properties :loose
    • babel-plugin-lodash
  • TypeScript [ *.ts ,*.tsx ]

{
  "compilerOptions": {
    "importHelpers": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": false,
    "declaration": true,
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "jsx": "react",
    "esModuleInterop": true,
    "noEmitOnError": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noResolve": false,
    "removeComments": true,
    "strictNullChecks": false,
    "inlineSourceMap": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "lib": [
      "dom",
      "es5",
      "es6",
      "es7",
      "es2015.promise",
      "es2018.promise",
      "es2015.collection",
      "es2015.core",
      "es2015",
      "es2016",
      "es2016.array.include",
      "es2017",
      "es2017.object",
      "es2018",
      "es2015.iterable"
    ]
  }
}
  • Less [ *.less ]

  • PostCSS [*.less, *.css]

     browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 8', 'iOS >= 8', 'Android >= 4']
    
  • Module CSS [*.module.css, *.module.less]

  • Font (file-loader) [*.woff, *.woff2, *.ttf, *.eot]

  • IMG (file-loader) [*.svg, *.png, *.jpg, *.jpeg, *.gif]

  • HTML (file-loader)

  • HBS (mustache-loader)

Extensible

提供的默认配置表皆可修改. 在 package.json 的同级目录下创建一个 webpack.config.js 文件

module.exports = async function(context) {
  // do your need ...
  //e.
  // context.babelOptions.plugins.push("babel-plugin-xxx")
}
  • Plugin configuration
//Babel
context.babelOptions = {}

//loaders
context.rules = []

//postcss
context.postcssOptions = {}

//typescript
context.tsOptions = {}

//source-map
context.devtool = ''

//all in one *
context.webpackConfig = {}
  • ENV Variables
  • VERSION : e.g. 1.0.0
  • APPLICATION_VERSION: e.g. 1.0.0-beta / 1.0.0-dev / 1.0.0
  • __DEV__ : is development
context.defines = {
  VERSION: '"1.0.0"',
  APP_NAME: '"DEMO"'
}
  • Copy Files to Dist
context.files = {
  'whatwg-fetch': { path: 'node_modules/whatwg-fetch/fetch.js' },
  'es6-promise': { path: 'node_modules/es6-promise/dist/es6-promise.auto.min.js' }
  //...
}
  • Externals Files
context.externals = {
  react: { name: 'React', path: 'node_modules/react/dist/react-with-addons.js' },
  'react-dom': { name: 'ReactDOM', path: 'node_modules/react-dom/dist/react-dom.js' }
  //...
}
  • Global Provides
context.provides = {
  React: 'react',
  ReactDOM: 'react-dom'
}
  • SDK (include CDN Files)
context.sdk = {
  index: ['a.js', 'b,js', 'http://xxx/xxx/xxx.js'],
  index1: ['a.js', 'b,js', 'c.js', 'http://xxx/xxx/xxx.js'],
  index2: ['a.js', 'b,js', 'd.js', 'http://xxx/xxx/xxx.js']
}

DLL Support

//webpack.dll.js
context.dll = ['react', 'react-dom', 'moment' /* ... */]

//webpack.config.js | webpack.build.js
context.dll = true // === context.dll = './dll'
context.dll = './src/dll'

Current Tags

  • 3.0.2                                ...           latest (a month ago)

172 Versions

  • 3.0.2                                ...           a month ago
  • 3.0.1                                ...           a month ago
  • 3.0.0                                ...           a month ago
  • 2.3.1                                ...           2 months ago
  • 2.3.0                                ...           3 months ago
  • 2.2.2                                ...           4 months ago
  • 2.2.1                                ...           5 months ago
  • 2.2.0                                ...           5 months ago
  • 3.0.0-beta.2                                ...           5 months ago
  • 2.1.12                                ...           6 months ago
  • 3.0.0-beta.1                                ...           6 months ago
  • 3.0.0-beta.0                                ...           6 months ago
  • 2.1.11                                ...           6 months ago
  • 2.1.10                                ...           6 months ago
  • 2.1.8                                ...           6 months ago
  • 2.1.7                                ...           6 months ago
  • 2.1.6                                ...           6 months ago
  • 2.1.5                                ...           6 months ago
  • 2.1.4                                ...           6 months ago
  • 2.1.3                                ...           6 months ago
  • 2.1.2                                ...           6 months ago
  • 2.1.1                                ...           6 months ago
  • 2.1.0                                ...           6 months ago
  • 2.0.0                                ...           7 months ago
  • 2.0.0-beta.9                                ...           7 months ago
  • 2.0.0-beta.8                                ...           7 months ago
  • 2.0.0-beta.6                                ...           7 months ago
  • 2.0.0-beta.5                                ...           7 months ago
  • 2.0.0-beta.4                                ...           8 months ago
  • 2.0.0-beta.3                                ...           8 months ago
  • 1.4.100                                ...           8 months ago
  • 1.4.90                                ...           8 months ago
  • 1.4.88                                ...           9 months ago
  • 1.4.83                                ...           9 months ago
  • 1.4.82                                ...           9 months ago
  • 1.4.81                                ...           9 months ago
  • 1.4.81-beta.1                                ...           9 months ago
  • 1.4.80-beta.1                                ...           9 months ago
  • 1.4.75-beta.62                                ...           9 months ago
  • 1.4.75-beta.61                                ...           9 months ago
  • 1.4.74                                ...           9 months ago
  • 1.4.72                                ...           9 months ago
  • 1.4.70                                ...           9 months ago
  • 1.4.61                                ...           10 months ago
  • 1.4.60                                ...           10 months ago
  • 1.4.40                                ...           a year ago
  • 1.4.38                                ...           a year ago
  • 1.4.32                                ...           a year ago
  • 1.4.30                                ...           a year ago
  • 1.4.20                                ...           a year ago
  • 1.4.10                                ...           a year ago
  • 1.4.8                                ...           a year ago
  • 1.4.7                                ...           a year ago
  • 1.4.6                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.4.0-beta.1                                ...           a year ago
  • 1.3.24                                ...           a year ago
  • 1.3.23                                ...           a year ago
  • 1.3.22                                ...           a year ago
  • 1.3.21                                ...           a year ago
  • 1.3.20                                ...           a year ago
  • 1.1.0-beta.22                                ...           a year ago
  • 1.3.18                                ...           a year ago
  • 1.1.0-beta.21                                ...           a year ago
  • 1.1.0-beta.20                                ...           a year ago
  • 1.3.17-beta.0                                ...           a year ago
  • 1.3.16                                ...           a year ago
  • 1.3.15                                ...           a year ago
  • 1.3.14                                ...           a year ago
  • 1.3.13                                ...           a year ago
  • 1.3.12                                ...           a year ago
  • 1.3.11                                ...           a year ago
  • 1.3.9                                ...           a year ago
  • 1.3.7                                ...           a year ago
  • 1.3.6                                ...           a year ago
  • 1.3.5                                ...           a year ago
  • 1.3.4                                ...           a year ago
  • 1.3.3                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.1.0-beta.15                                ...           a year ago
  • 1.1.0-beta.14                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0-beta.13                                ...           a year ago
  • 1.1.0-beta.12                                ...           a year ago
  • 1.1.0-beta.10                                ...           a year ago
  • 1.1.0-beta.8                                ...           a year ago
  • 1.1.0-beta.6                                ...           a year ago
  • 1.1.0-beta.4                                ...           a year ago
  • 1.1.0-beta.2                                ...           a year ago
  • 1.1.0-beta.0                                ...           a year ago
  • 1.0.0-beta.32                                ...           a year ago
  • 1.0.0-beta.30                                ...           a year ago
  • 1.0.0-beta.24                                ...           a year ago
  • 1.0.0-beta.23                                ...           a year ago
  • 1.0.0-beta.22                                ...           a year ago
  • 1.0.0-beta.20                                ...           a year ago
  • 1.0.0-beta.18                                ...           a year ago
  • 1.0.0-beta.16                                ...           a year ago
  • 1.0.0-beta.14                                ...           a year ago
  • 1.0.0-beta.12                                ...           a year ago
  • 1.0.0-beta.11                                ...           a year ago
  • 1.0.0-beta.9                                ...           a year ago
  • 1.0.0-beta.8                                ...           a year ago
  • 1.0.0-beta.7                                ...           a year ago
  • 1.0.0-beta.6                                ...           a year ago
  • 1.0.0-beta.5                                ...           2 years ago
  • 1.0.0-beta.1                                ...           2 years ago
  • 1.0.0-beta.0                                ...           2 years ago
  • 0.7.2                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.8                                ...           2 years ago
  • 0.6.7                                ...           2 years ago
  • 0.6.6                                ...           2 years ago
  • 0.6.5                                ...           2 years ago
  • 0.6.4                                ...           2 years ago
  • 0.6.3                                ...           2 years ago
  • 0.6.2                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.31                                ...           2 years ago
  • 0.5.21                                ...           2 years ago
  • 0.5.20                                ...           2 years ago
  • 0.5.10                                ...           2 years ago
  • 0.5.8                                ...           2 years ago
  • 0.5.6                                ...           2 years ago
  • 0.5.5                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.30                                ...           2 years ago
  • 0.3.24                                ...           2 years ago
  • 0.3.23                                ...           2 years ago
  • 0.3.22                                ...           2 years ago
  • 0.3.21                                ...           2 years ago
  • 0.3.20                                ...           2 years ago
  • 0.3.10                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.5                                ...           2 years ago
  • 0.2.4                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
  • 0.0.14                                ...           2 years ago
  • 0.0.13                                ...           2 years ago
  • 0.0.12                                ...           2 years ago
  • 0.0.11                                ...           2 years ago
  • 0.0.10                                ...           2 years ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 66
Dependencies (70)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |