1.0.14 • Published 1 year ago

gun-pack v1.0.14

Weekly downloads
-
License
CC0-1.0
Repository
-
Last release
1 year ago

gun-pack

react cli   react compiler

github

usage

react build tool, Support Typescript

    yarn add gun-pack 
  • package.json scripts
   gun-pack  dev
   gun-pack  build

   // after you build, also you can startup service
   gun-pack  server

You can customize your compiler configuration in your root directory

  • gun.config.js example:
const config = {
    port: 9000,                         
    defaultEntry: true,
    defaultHtmlPlugin: true,
    openBrowser: false,
    writeToDisk: false
    publicPath: '/',
    entry:null,                      // Object<webpackEntry> | null | array<webpackEntry>
    proxy: {
       '/api': {
           target: 'http://localhost:3000',
           pathRewrite: {'^/api': ''},
       },
    },
    htmlPluginOption: [                    //  null | Array<object>
        {                   
            template: path.join(__dirname, './src/index.html'),
            chunks: ['main', 'react'],
            options
        }
    ], 
    definePluginOption:{
        'process.env.NODE_ENV': JSON.stringify('production'),
        'definePlugin':JSON.stringify('definePlugin'),
    },
    hot: true,
    liveReload: false
}

module.exports = config

Parameter description

parameterdescription
port listener port ; default 9000
open_browser auto browser open page
default_entry Use default entry /src/index.js ; default true
default_htmlPlugin Use default htmlPlugin /src/index.html ; default true
writeToDisk default false
publicPath default '/'
entryObject\<webpackEntry> / null when defaultEntry is false, customize yourself
proxyObject\<webpackDevServerProxy>
htmlPluginOptionArray / null when defaultHtmlPlugin is false, customize yourself
definePluginOptionObject\<webpack.definePlugin.option>, when gun-pack dev , process.env.NODE_ENV default development, when gun-pack build , process.env.NODE_ENV default production