0.16.0 • Published 4 years ago

wcb v0.16.0

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

#+HTML: WCB Webpack Config builder [https://www.npmjs.org/package/wcb] [https://travis-ci.org/jupl/wcb] [https://codecov.io/gh/jupl/wcb] [https://david-dm.org/jupl/wcb] [https://david-dm.org/jupl/wcb?type=peer] [https://david-dm.org/jupl/wcb?type=dev]

** About Personal [https://webpack.js.org/] config builder, targeted specifically for [https://www.typescriptlang.org/].

** Installation #+BEGIN_EXAMPLE npm install typescript wcb webpack #+END_EXAMPLE

** Usage #+BEGIN_SRC typescript import {addToEntries, createConfiguration} from 'wcb' const base = createConfiguration() const tweaked = createConfiguration({ source: 'src', destination: 'dist', assets: 'assets', }) const extra = addToEntries(createConfiguration({ common: true, cssLoaders: [{test: /.css$/, use: 'css-loader'], }), 'dotenv/config', )

// webpack.config.ts import {createConfiguration} from 'wcb' export default createConfiguration() #+END_SRC

Environment Variables The following environment variables are available for things like DCE: * ~process.env.IS_CLIENT~ This is ~'true'~ if ~target~ is set to ~'web'~ or ~'webworker'~. Otherwise it is ~'false'~. Useful when using shared code. ~process.env.NODE_ENV~ This is read from the environment variable value set. Otherwise it is ~undefined~. ~process.env.WEBPACK_BUILD~ This is always set to ~'true'~. This can be used for cases like when writing code for Node and run development code outside of Webpack.

API * ~createConfiguration(options?: Options): Configuration~ Create a [https://webpack.js.org/concepts/configuration/] which can be used by a =webpack.config= file. ~addPlugins(configuration: Configuration, plugins: Plugin[]): Configuration~ Given an existing configuration from ~createConfiguration~, add [https://webpack.js.org/concepts/plugins/] easily. Please note that this will return a new configuration and does not modify the given configuration. ~addRules(configuration: Configuration, rules: Rule[]): Configuration~ Given an existing configuration from ~createConfiguration~, add [https://webpack.js.org/concepts/loaders/] easily. Please note that this will return a new configuration and does not modify the given configuration. ** ~addToEntries(configuration: Configuration, modules: string[]): Configuration~ Given an existing configuration from ~createConfiguration~, load additional Node files to each entry. Please note that this will return a new configuration and does not* modify the given configuration.

Options * ~assets: string | boolean = false~ Path that contains static files to copy over to the final build. Path is relative to ~process.cwd()~. The following occurs in order from top to bottom:

0.16.0

4 years ago

0.15.2

5 years ago

0.15.1

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.5

5 years ago

0.13.4

5 years ago

0.13.3

5 years ago

0.13.2

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.6

5 years ago

0.12.5

5 years ago

0.12.4

5 years ago

0.12.3

5 years ago

0.12.2

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.2

5 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago