1.0.3 • Published 4 years ago

@nerjs/webpack v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

frequently used webpack config

Install

npm i @nerjs/webpack

or

yarn add @nerjs/webpack

Use

const createWebpackConfig = require('@nerjs/webpack')
// or es6:
import { createWebpackConfig } from '@nerjs/webpack'

const config = createWebpackConfig({ /* ...settings */ })

Settings:

propNametyperequireddescriptiondefault
contextString:white_check_mark:webpack.config context prop
nameString:white_check_mark:webpack.config entry name prop
entryPathString:white_check_mark:webpack.config entry path prop
outputPathString:white_check_mark:webpack.config output path prop
publicPathStringwebpack.config output publick path prop'/'
outputFilenameStringwebpack.config output filename prop'./js/[name].js'
watchBooleanwebpack.config watch propprocess.env.NODE_ENV !== 'production'
modeStringwebpack.config mode propprocess.env.NODE_ENV || 'development'
devtoolStringwebpack.config devtool propprocess.env.NODE_ENV === 'production' ? false : 'inline-source-map'
reactBooleanHas react preset in babel module.rulefalse
reactHotBooleanHas react-hot-loader presets, plugins and webpack-hot-middlewarefalse
gqlBooleanAdd graphql module to rulesfalse
styledBooleanHas styled-components to babel pluginsfalse
targetsObjectSchema babel module target in preset-env{ browsers: 'last 3 versions' }
envObjectEnvironment thrown into a bundle (webpack.DefinePlugin). All variables are wrapped in JSON.stringify(){ 'process.env.NODE_ENV': process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV }
dotEnvBooleanHas webpack plugin dotenv-webpackfalse

:link: All utils