@anansi/webpack-config
Webpack config
Last updated 2 days ago by ntucker .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @anansi/webpack-config 
SYNC missed versions from official npm registry.

@anansi/webpack-config

A webpack configuration for fast development and production ready optimizations

Usage

/webpack.config.js

const { makeConfig } = require('@anansi/webpack-config');

const options = {
  basePath: 'src',
  buildDir: 'generated_assets/',
};

module.exports = makeConfig(options);

/package.json

{
  "scripts": {
    "start:dev": "webpack-dev-server --mode=development",
    "build": "webpack --mode=production",
    "analyze": "webpack --mode=production --analyze",
    "pkgcheck": "webpack --check=nobuild"
  }
}

CMD line arguments

analyze

If set, will build a static treemap visualization of your packages. Highly recommended to run in production mode to get accurate results.

check

If set will run package checks to check for duplicates or ciruclar dependencies. Set equal to 'nobuild' for a standalone run where build output is not needed.

Examples: webpack --mode=production --check or webpack --check=nobuild

Options

Pass these to makeConfig.

libraryInclude/libraryExclude

Regex to match libraries to include in the normal build process. This is useful for locally developed modules or yarn workspaces. Not this should point to the installed location, rather than the actual target. Note you'll need both the positive and negative regexes.

libraryExclude defaults to /node_modules/, which will exclude libraries from expensive and potentially incorrect processing from babel loaders.

To match all libraries in namespace @myspacespace:

const myConfig = makeConfig({
  libraryInclude: /node_modules\/(@mynamespace\/)/,
  libraryExclude: /node_modules(?!\/(@mynamespace\/))/,
})

basePath = 'src'

Marks the base directory inside the package for javascript source files. This is used to make it easy to import from the root.

Example:

-package.json
-/src
  -/components
  -/pages
  -/utils
    -network.js

Then you can do

import fetch from 'network';

from any file.

buildDir = 'generated_assets/'

Output directory for production build files

File Support

  • SCSS with CSS modules
    • Use ${basePath}/style/export.scss to add variables or mixins avaiable in all scss files
    • Put global styles within ${basePath}/style
    • Other styles will be treated as css modules
  • Web workers
  • All font formats
  • Any media files
  • And of course javascript

Current Tags

  • 0.5.3                                ...           latest (2 days ago)

51 Versions

  • 0.5.3                                ...           2 days ago
  • 0.5.2                                ...           2 days ago
  • 0.5.0                                ...           2 days ago
  • 0.4.5                                ...           a month ago
  • 0.4.4                                ...           2 months ago
  • 0.4.3                                ...           2 months ago
  • 0.4.2                                ...           2 months ago
  • 0.4.1                                ...           2 months ago
  • 0.4.0                                ...           2 months ago
  • 0.3.4                                ...           2 months ago
  • 0.3.4-alpha.2                                ...           2 months ago
  • 0.3.4-alpha.1                                ...           2 months ago
  • 0.3.4-alpha.0                                ...           2 months ago
  • 0.3.3                                ...           2 months ago
  • 0.3.2                                ...           2 months ago
  • 0.3.1                                ...           2 months ago
  • 0.3.1-alpha.3                                ...           3 months ago
  • 0.3.1-alpha.2                                ...           3 months ago
  • 0.3.1-alpha.1                                ...           3 months ago
  • 0.3.1-alpha.0                                ...           3 months ago
  • 0.3.0                                ...           3 months ago
  • 0.2.16-alpha.2                                ...           3 months ago
  • 0.2.16-alpha.1                                ...           3 months ago
  • 0.2.16-alpha.0                                ...           3 months ago
  • 0.2.15                                ...           3 months ago
  • 0.2.14                                ...           3 months ago
  • 0.2.13                                ...           3 months ago
  • 0.2.12                                ...           3 months ago
  • 0.2.11                                ...           3 months ago
  • 0.2.10                                ...           3 months ago
  • 0.2.9                                ...           3 months ago
  • 0.2.8                                ...           3 months ago
  • 0.2.7                                ...           3 months ago
  • 0.2.6                                ...           3 months ago
  • 0.2.5                                ...           3 months ago
  • 0.2.4                                ...           3 months ago
  • 0.2.3                                ...           3 months ago
  • 0.2.2                                ...           3 months ago
  • 0.2.1                                ...           6 months ago
  • 0.2.0                                ...           6 months ago
  • 0.1.4                                ...           6 months ago
  • 0.1.3                                ...           6 months ago
  • 0.1.2                                ...           6 months ago
  • 0.1.1                                ...           6 months ago
  • 0.1.0                                ...           6 months ago
  • 0.0.5-beta.0                                ...           6 months ago
  • 0.0.5                                ...           6 months ago
  • 0.0.4                                ...           6 months ago
  • 0.0.3                                ...           6 months ago
  • 0.0.2                                ...           6 months ago
  • 0.0.1                                ...           6 months ago
Maintainers (1)
Downloads
Today 2
This Week 30
This Month 61
Last Day 28
Last Week 31
Last Month 187
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |