My collection of Webpack Blocks
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.prettierrc
README.md
package-lock.json
package.json

README.md

Pravdomil Blocks

My collection of Webpack Blocks

Install

npm i @pravdomil/blocks -D

API

See src/index.js.

GlobalDescription
client()

Sets name to "client" and target to "web".

server()

Sets name to "server" and target to "node".

version()

Sets VERSION env variable to package.json version.

mode()

Sets mode based on NODE_ENV.

stylish()

Sets output to use Stylish.

useSourceMaps()
  • Sets development source maps to original source with lines only.
  • Sets production source maps to expose filenames and structure but no original source content.
  • Adds source map support for node.js.
hotModuleReplacement()

Enable client hot module replacement.

babelPolyfill()

Includes babel polyfill. Make sure that this is the first entry point.

babel()

Use babel-loader on all .js and .jsx files.

  • presets: preset-env, preset-react
  • plugins: plugin-syntax-dynamic-import
files()

Adds files as dependency and returns it's path.

import png from "./assets/image.png"
png = "/publicPath/4de6ffe4d2ade67a249f7411ae896b36.png"
sass()

Use sass-loader on css and sass files.

noSass()

Use null-loader on css and sass files.

stats(filename, fields)

Writes webpack stats to file.

Donate

By buying a beer.