Project toolkit base on webpack,babel,eslint and prettier.
global install:
npm install ko -g
yarn global add ko
install as devDependencies
:
npm install ko -D
yarn add ko -D
use webpack to bundle files. The supported options are:
--hash
: output filename with hash-t,--ts,--typescript
: support typescript-e, --env [env]
: user defined building environment
use webpack-dev-server
to start devServer
. The supported options are:
-p, --port <port>
: server start on which port--host <host>
: server start on which host-t, --ts
: support typescript-a,--analyzer
: support building analyzer(internal usewebpack-bundle-analyzer
)
ko prettier (ko pr) [patterns]
use prettier
to format your codes. The supported options are:
-w, --write
: Edit files in-place. (Beware!)-c, --config <configPath>
: set prettier config path
ko eslint [patterns]
use eslint
to format your codes.The supported options are:
-c, --config <path>
: set eslint config path
You can configure ko build
and ko dev
via ko.config.js
. User defined webpack configurations like customized entry & output,add plugins or loaders will be merged by webpack
when webpack initiate.
module.exports = {
entry: './src/app.tsx',
output: {
publicPath: isDev ? '/' : '/easyIndex/',
},
plugins: [
new CopyWebpackPlugin(copyConfig),
],
externals: {
APP_CONF: 'APP_CONF',
},
resolve: {
fallback: {
fs: false,
path: false,
events: false,
os: require.resolve('os-browserify/browser'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
},
},
devServer: {
proxy,
host: '0.0.0.0',
port: 8084,
},
};
All list above will be merged, for more configurations, please read webpack configuration
*.DS_Store
*.idea
node_modules*
static*
set ignore patterns for eslint
and prettier
like .gitignore